Posted by: johnk - Tuesday, 30 April 2013 07:54:51
I am trying to integrate YAF with existing site. Here are the exact steps I took:
1. Download latest build from codeplex (build from Jaben on April 28)
2. Extract all files in /forum subfolder
3. I moved the following to main root folder: all config files, App_Browser, App_Data
4. Updated settings as mentioned here: http://yafnet.codeplex.com/wikipage?title=YAF.NET%20Integration%20in%20to%20an%20existing%20ASP.NET%20Application&referringTitle=Documentation
I could not find /Bin and /App_Code folder at all in the latest builds.
When I run /forum/install/default.aspx, I get the following error in web.config file:
[color=red]CS0246: The type or namespace name 'YAF' could not be found (are you missing a using directive or an assembly reference?)[/color]
I tried moving YAF.csproj to root folder but it still is not working and gives above error message.
However when I download the latest build and run it as is (without creating /forum subfolder) then it is working properly.
[b]Any idea what files I should be putting in root folder based on these nightly builds?[/b]
I am guessing /App_code folder is not there in root folder and it is trying to find that file and erroring out.
It looks like catch 22 scenario: Since I cannot run /install/default.aspx, it cannot create /App_Code folder. And it cannot run /install/default.aspx since it first loads web.config and errors out (since App_Code folder is not present).
Thank you for your help :)
Posted by: tha_watcha - Tuesday, 30 April 2013 16:21:11
[quote]I could not find /Bin and /App_Code folder at all in the latest builds.[/quote]
No there is no app_code folder anymore. What nightly builds are you mean?
I downloaded the latest nightly build from the build server (http://build.yetanotherforum.net/) and there is a bin folder in the zip.
Posted by: johnk - Wednesday, 1 May 2013 04:57:54
I am downloading the nightly build from the codeplex site.
I looked at the http://build.yetanotherforum.net and it does have /Bin folder in it (which is not present in codeplex site). I had assumed that both sites (codeplex and build.yaf.net) had the exact same files.
Thank you for pointing out the difference :)
Posted by: tha_watcha - Wednesday, 1 May 2013 05:52:29
[quote=johnk;59283]I am downloading the nightly build from the codeplex site.
I looked at the http://build.yetanotherforum.net and it does have /Bin folder in it (which is not present in codeplex site). I had assumed that both sites (codeplex and build.yaf.net) had the exact same files.
Thank you for pointing out the difference :)[/quote]
No the codeplex page doesn't have any nightly builds, it only contains the source code. And if you want to use it from there you need to compile it yourself.
Posted by: johnk - Thursday, 2 May 2013 00:32:32
Thanks for the clarification. I noticed that we can download the build and the source code from the http://build.yetanotherforum.net site :)
Posted by: johnk - Thursday, 2 May 2013 08:24:09
I download the latest build from build.yaf.net site and integrated into existing site (per the updated doc on codeplex mentioned above)
When I ran the /forum/install.aspx page, it gave me the following error
"[color=red]Could not load file or assembly 'Autofac, Version=3.0.0.0, Culture=neutral, PublicKeyToken=17863af14b0044da' or one of its dependencies. The system cannot find the file specified.[/color]"
When I looked into /Bin folder, it did NOT have the file "Autofac.dll" file.
So, I downloaded the entire source code and did a build (by running the build.bat file). The build was successful.
I noticed the following differences:
In newly built folder: /Bin had 46 files (including Autofac.dll)
In prebuild folder (from build.yaf.net): /Bin only had 19 files.
Questions:
1. I am guessing something is wrong if the prebuilt folder /Bin only has 19 items in it (instead of 46)?
2. Did I create the build correctly (by using build.bat file)?
3. What is the difference between build.bat and buildpackage.bat (when to use each one)?
Thank you for your help :)
Posted by: tha_watcha - Thursday, 2 May 2013 16:05:59
[quote=johnk;59302]In newly built folder: /Bin had 46 files (including Autofac.dll)
In prebuild folder (from build.yaf.net): /Bin only had 19 files.
1. I am guessing something is wrong if the prebuilt folder /Bin only has 19 items in it (instead of 46)?
2. Did I create the build correctly (by using build.bat file)?
3. What is the difference between build.bat and buildpackage.bat (when to use each one)?
Thank you for your help :)[/quote]
1. Looks like there are two dlls missing it should been 21 dlls (you only need the dlls) AutoFac.dll and Omu.ValueInjecter.dll. But i don't know why i don't maintain the server.
2. Yes if you dont have Visual Studio.
3. The differences are that the build.bat does only compile the solution. The Buildpackages compiles and creates 3 different ZIP Packages
1 = Source Package (YAF-v2.0.0.0-RTW-SRC)
2 = Install Package (YAF-v2.0.0.0-RTW-Install) that contains all files when you want to make a new Install of the forum
3 = The Upgrade Package (YAF-v2.0.0.0-RTW-Upgrade) that contains all files when you want to upgrade an forum installation.
Posted by: johnk - Friday, 3 May 2013 07:18:28
I did a manual check. In the prebuilt zip file, there are only 15 DLLs in the /Bin folder. The other files are two PDB, one config and one XML.
In the manual build, there are 21 DLLs, 1 config, 13 PDB and 11 XML files.
Also does the build.bat file make changes to any other folder (apart from /Bin)? I noticed the /obj/release folder was updated (all three files).
Posted by: johnk - Friday, 3 May 2013 09:37:59
Update:
I just downloaded the full source code. Then I ran build.bat to compile it. I copied the web.config to root folder. Then I ran /install/default.aspx and I keep getting the same error:
[color=red]Failed to map the path '/'.
Source File: d:\yafnet-e93edaa82782\yafnet_e93edaa82782\yafsrc\YAF.Utils\Helpers\ConfigHelper.cs Line: 100 [/color]
I tried this many times and get the same error message. If it helps I am using Visual Studio Express 2012 for Web. Is it possible for you to upload a "good" build to http://build.yetanotherforum.net site or to codeplex site?
I have attached the error message in screenshot below:
Posted by: tha_watcha - Saturday, 4 May 2013 19:33:20
[quote]I tried this many times and get the same error message. If it helps I am using Visual Studio Express 2012 for Web. Is it possible for you to upload a "good" build to http://build.yetanotherforum.net site or to codeplex site?[/quote]
The latest build from the http://build.yetanotherforum.net/ page contains now all dlls.
Posted by: johnk - Sunday, 5 May 2013 07:34:35
Thank your for uploading the latest build. I am still getting an error after clean install. Here are the steps:
1. Download the latest build from http://build.yetanotherforum.net
2. Install in a new folder
3. Move web.config to root folder (and turn off customerror in webconfig)
4. Run /install/default.aspx
The error is
[color=red]Failed to map the path '/'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.InvalidOperationException: Failed to map the path '/'[/color]
I also checked the /Bin directory has 21 DLLs in it. I haven't changed anything else. Its a clean install.
I have attached a screenshot of the error message. In the screenshot, if you look into the section [ConfigurationErrorsException:], it looks like some path is hardcoded
c:\TeamCity\buildAgent\work\a43418c417bd9823\yafsrc\YAF.Utils\Helpers\ConfigHelper.cs:100
c:\TeamCity\buildAgent\work\a43418c417bd9823\yafsrc\YAF.Utils\Helpers\ConfigHelper.cs:139
c:\TeamCity\buildAgent\work\a43418c417bd9823\yafsrc\YAF.Utils\Helpers\ConfigHelper.cs:73
Posted by: johnk - Sunday, 5 May 2013 08:19:59
Update (I was able to resolve the error):
I created the folder which was hardcoded "c:\TeamCity\buildAgent\work\a43418c417bd9823\yafsrc\" and copied all files in it.
Then when I ran /install/default.aspx, it told me the exact souce of error
It was in line 100 of ConfigHelper.cs
[code=csharp]return this._webConfig ?? (this._webConfig = WebConfigurationManager.OpenWebConfiguration("~/"));[/code]
I did a google search and found out that it is for getting web.config of remote server (in this case ~/).
Then I check my Visual Studio Express 2012 server setting and it was running under "Visual Studio Development Server". I simply changed it to "IIS Express" and suddenly the pages started loading correctly.
I had read a long time ago that Visual Studio Development Server is very secure and blocks all outside access. In this case it was also blocking the code in Line 100. Hence changing it back to IIS Express made it work correctly. Thank you so much for your help. I will continue testing and post bug report here.
BTW, the folder in "c:\TeamCity\buildAgent\work\a43418c417bd9823\yafsrc" is no longer needed - though it was useful to get to the actual error message. Thanks again [biggrin]