YAFLogo

johnk
  • johnk
  • 74.8% (Friendly)
  • YAF All-the-Time Topic Starter
11 years ago
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

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:

CS0246: The type or namespace name 'YAF' could not be found (are you missing a using directive or an assembly reference?)

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.

Any idea what files I should be putting in root folder based on these nightly builds?

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 :)

Sponsor
tha_watcha
  • tha_watcha
  • 100% (Exalted)
  • YAF.NET Project Lead 🤴 YAF Version: 4.0.0 rc 2
11 years ago

I could not find /Bin and /App_Code folder at all in the latest builds.

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.

johnk
  • johnk
  • 74.8% (Friendly)
  • YAF All-the-Time Topic Starter
11 years ago
I am downloading the nightly build from the codeplex site.

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 🙂

tha_watcha
  • tha_watcha
  • 100% (Exalted)
  • YAF.NET Project Lead 🤴 YAF Version: 4.0.0 rc 2
11 years ago

I am downloading the nightly build from the codeplex site.

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 :)

Originally Posted by: johnk 

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.

johnk
  • johnk
  • 74.8% (Friendly)
  • YAF All-the-Time Topic Starter
johnk
  • johnk
  • 74.8% (Friendly)
  • YAF All-the-Time Topic Starter
11 years ago
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

"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."

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 🙂

tha_watcha
  • tha_watcha
  • 100% (Exalted)
  • YAF.NET Project Lead 🤴 YAF Version: 4.0.0 rc 2
11 years ago

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 :)

Originally Posted by: johnk 

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.

johnk
  • johnk
  • 74.8% (Friendly)
  • YAF All-the-Time Topic Starter
11 years ago
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).

johnk
  • johnk
  • 74.8% (Friendly)
  • YAF All-the-Time Topic Starter
11 years ago
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:

Failed to map the path '/'.

Source File: d:\yafnet-e93edaa82782\yafnet_e93edaa82782\yafsrc\YAF.Utils\Helpers\ConfigHelper.cs Line: 100

http://build.yetanotherforum.net  site or to codeplex site?

I have attached the error message in screenshot below:

tha_watcha
  • tha_watcha
  • 100% (Exalted)
  • YAF.NET Project Lead 🤴 YAF Version: 4.0.0 rc 2
11 years ago
http://build.yetanotherforum.net  site or to codeplex site?

http://build.yetanotherforum.net/  page contains now all dlls.

johnk
  • johnk
  • 74.8% (Friendly)
  • YAF All-the-Time Topic Starter
11 years ago
Thank your for uploading the latest build. I am still getting an error after clean install. Here are the steps:

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

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 '/'

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

johnk
  • johnk
  • 74.8% (Friendly)
  • YAF All-the-Time Topic Starter
11 years ago
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

return this._webConfig ?? (this._webConfig = WebConfigurationManager.OpenWebConfiguration("~/"));

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 😁

Users browsing this topic