Ganamede
  •  Ganamede
  • 53.6% (Neutral)
  • YAF Forumling Topic Starter
2010-02-25T23:19:28Z
Hello everyone. I've spent a lot of time trying to get YAF v1.9.4-RC-1 to work when installed in a sub directory. I have gone through every suggestion in this forum and searched the web but I can't get it to work. I'm going to post the steps I've taken and I really hope someone can spot what I'm doing wrong. I have managed to get it working when installing YAF in the root directory, but not the sub directory. Thanks in advance.

Firstly, I'm using Visual Studio 2008 and SQL Server 2008 Express with SQL Server Management Studio.

1. Create new project in VS 2008
2. Copy YetAnotherForum.NET to /forum on web site
3. Copy recommended-NET-web.config to root of site
4. Copied YAF folder from App_Data of /forum directory to App_Data of root directory
5. Copied contents of Bin folder from /forum directory to Bin folder of root directory
6.Got errors saying that "The type of namespace 'Classes does not exist in the namespace 'Yaf' and 765 other simliar errors. Added references to all .dll files in bin of root directory. Also needed to add a reference to System.ServiceModel.Web.
7. Changed Web.config
<connectionStrings configSource="forum/db.config"/>
<appSettings configSource="forum/app.config"/>
<rewriter configSource="forum/URLRewriter.config"/>
8. Changed App.config to <add key="YAF.AppRoot" value="~/forum" />

At this point when I build I get 2430 errors saying that controls and methods don't exist and ask if I'm missing a reference. I'm at a loss as to what to do next.

This is my web.config file:

<?xml version="1.0"?>
<configuration>
	<configSections>
		<sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
			<sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
				<section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
				<sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
					<section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="Everywhere"/>
					<section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
					<section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
					<section name="roleService" type="System.Web.Configuration.ScriptingRoleServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
				</sectionGroup>
			</sectionGroup>
		</sectionGroup>
		<section name="rewriter" type="Intelligencia.UrlRewriter.Configuration.RewriterConfigurationSectionHandler, Intelligencia.UrlRewriter" requirePermission="false"/>
	</configSections>
	<connectionStrings configSource="forum/db.config"/>
	<appSettings configSource="forum/app.config"/>
	<rewriter configSource="forum/URLRewriter.config"/>
	<system.net>
		<mailSettings>
			<smtp configSource="forum/mail.config"/>
		</mailSettings>
	</system.net>
	<system.web>
		<trace enabled="false"/>
		<xhtmlConformance mode="Transitional"/>
		<customErrors defaultRedirect="Error.aspx" mode="On"/>
		<globalization requestEncoding="utf-8" responseEncoding="utf-8"/>
		<authentication mode="Forms">
			<forms name=".YAFNET_Authentication" protection="All" timeout="43200" cookieless="UseCookies"/>
		</authentication>
		<!-- Set debug to "true" to test out the system in development -->
		<compilation defaultLanguage="c#" debug="true">
			<assemblies>
				<add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
				<add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
				<add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
				<add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
				<add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
				<add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
				<add assembly="System.Data.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
			</assemblies>
		</compilation>
		<httpHandlers>
			<remove verb="*" path="*.asmx"/>
			<add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
			<add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
			<add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false"/>
      <add verb="POST,GET,HEAD" path="ajaxpro/*.ashx" type="AjaxPro.AjaxHandlerFactory, AjaxPro.2"/>
		</httpHandlers>
		<httpModules>
			<add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
			<add name="YafTaskModule" type="YAF.Classes.Core.YafTaskModule, YAF.Classes.Core"/>
			<add name="UrlRewriter" type="Intelligencia.UrlRewriter.RewriterHttpModule,Intelligencia.UrlRewriter"/>
		</httpModules>
		<pages validateRequest="false" smartNavigation="false">
			<controls>
				<add tagPrefix="DotNetAge" namespace="DNA.UI.JQuery" assembly="DNA.UI.JQuery"/>
				<add tagPrefix="DotNetAge" namespace="DNA.UI" assembly="DNA"/>
				<add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
				<add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
				<!-- Default: use non-dynamic (compiled classes) in YAF -->
				<add tagPrefix="YAF" namespace="YAF.Classes.UI" assembly="YAF.Classes.UI"/>
				<add tagPrefix="YAF" namespace="YAF.Classes.Utils" assembly="YAF.Classes.Utils"/>
				<add tagPrefix="YAF" namespace="YAF.Classes.Core" assembly="YAF.Classes.Core"/>
				<add tagPrefix="YAF" namespace="YAF.Classes.Data" assembly="YAF.Classes.Data"/>
				<add tagPrefix="YAF" namespace="YAF.Controls" assembly="YAF.Controls"/>
				<add tagPrefix="YAF" namespace="YAF.Controls.Statistics" assembly="YAF.Controls"/>
				<!-- Optional: use dynamic classes in YAF by moving all the YAF.x directories (YAF.Classes.*, YAF.Providers)
						into the App_Code\YAF directory. Delete the associated .dll files from the \bin directory. Comment out the above 
						"non-dynamic" namespaces above and enable these: 
				-->
				<!--add tagPrefix="YAF" namespace="YAF.Classes.UI" />
				<add tagPrefix="YAF" namespace="YAF.Classes.Utils" />
				<add tagPrefix="YAF" namespace="YAF.Classes.Data" />
				<add tagPrefix="YAF" namespace="YAF.Controls" />
				<add tagPrefix="YAF" namespace="YAF.Classes.Core" />
				<add tagPrefix="YAF" namespace="YAF.Controls.Statistics" /-->
				<add tagPrefix="YAF" namespace="YAF.Classes"/>
				<add tagPrefix="YAF" namespace="YAF"/>
			</controls>
			<namespaces>
				<add namespace="YAF"/>
				<add namespace="YAF.Classes.UI"/>
				<add namespace="YAF.Classes.Utils"/>
				<add namespace="YAF.Classes.Core"/>
				<add namespace="YAF.Controls"/>
				<add namespace="YAF.Classes.Data"/>
			</namespaces>
		</pages>
		<roleManager enabled="true" defaultProvider="YafRoleProvider">
			<providers>
				<clear/>
				<add connectionStringName="yafnet" applicationName="YetAnotherForum" name="YafRoleProvider" type="YAF.Providers.Roles.YafRoleProvider"/>
			</providers>
		</roleManager>
		<membership defaultProvider="YafMembershipProvider" hashAlgorithmType="SHA1">
			<providers>
				<clear/>
				<add connectionStringName="yafnet" applicationName="YetAnotherForum" name="YafMembershipProvider" requiresUniqueEmail="true" useSalt="true" type="YAF.Providers.Membership.YafMembershipProvider"/>
			</providers>
		</membership>
		<profile enabled="true" defaultProvider="YafProfileProvider" inherits="YAF.Classes.Utils.YafUserProfile">
			<providers>
				<clear/>
				<add connectionStringName="yafnet" applicationName="YetAnotherForum" name="YafProfileProvider" type="YAF.Providers.Profile.YafProfileProvider"/>
			</providers>
		</profile>
	</system.web>
	<system.web.extensions>
		<scripting>
			<!-- 
      		<scriptResourceHandler enableCompression="true" enableCaching="true" />
      		-->
		</scripting>
	</system.web.extensions>
	<system.webServer>
		<validation validateIntegratedModeConfiguration="false"/>
		<modules>
			<remove name="ScriptModule"/>
			<remove name="YafTaskModule"/>
			<remove name="UrlRewriter"/>
			<add name="ScriptModule" preCondition="managedHandler" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
			<add name="YafTaskModule" type="YAF.Classes.Core.YafTaskModule, YAF.Classes.Core" preCondition="managedHandler"/>
			<add name="UrlRewriter" type="Intelligencia.UrlRewriter.RewriterHttpModule,Intelligencia.UrlRewriter" preCondition="managedHandler"/>
		</modules>
		<handlers>
			<remove name="WebServiceHandlerFactory-Integrated"/>
			<remove name="ScriptHandlerFactory"/>
			<remove name="ScriptHandlerFactoryAppServices"/>
			<remove name="ScriptResource"/>
			<add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
			<add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
			<add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
      <add name="AjaxPro" verb="POST,GET,HEAD" path="ajaxpro/*.ashx" type="AjaxPro.AjaxHandlerFactory, AjaxPro.2"/>
		</handlers>
	</system.webServer>
	<system.codedom>
		<compilers>
			<compiler language="c#;cs;csharp" extension=".cs" warningLevel="4" type="Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
				<providerOption name="CompilerVersion" value="v3.5"/>
				<providerOption name="WarnAsError" value="false"/>
			</compiler>
			<compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" warningLevel="4" type="Microsoft.VisualBasic.VBCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
				<providerOption name="CompilerVersion" value="v3.5"/>
				<providerOption name="OptionInfer" value="true"/>
				<providerOption name="WarnAsError" value="false"/>
			</compiler>
		</compilers>
	</system.codedom>
</configuration>

Sponsor
Ederon
2010-02-26T08:33:34Z
You're not the first one who reports difficulty setting up YAF in subfolder. I'll look into it when I got some time to spare.

FP:Ederon
When I post FP:Ederon in a topic, I'm leaving my footprint there so I can track it once I get into coding/supporting.
UserPostedImage 
logan
  •  logan
  • 100% (Exalted)
  • YAF Leader
2010-02-26T08:35:03Z
<add key="YAF.FileRoot" value="~/Forum"/>


<add key="YAF.AppRoot" value="~/Forum" />

This is the way i set it up.
logan attached the following image(s):

test
Ganamede
  •  Ganamede
  • 53.6% (Neutral)
  • YAF Forumling Topic Starter
2010-02-26T12:49:15Z
Thank you guys, I really appreciate the reply.
logan - I have those added those keys in app.config and I also moved the rest of the config files to the root directory and its still not working.

I've done more testing and all of the controls in the .ascx are not being recognized in the code behind page and I'm getting errors like "The name xxxx does not exist in the current context".

Also, all of the CssClasses are throwing errors that the CssClass value is not defined. What do I do to get the themes working in a sub directory?
logan
  •  logan
  • 100% (Exalted)
  • YAF Leader
2010-02-27T02:01:43Z
Did you change these back to normal no forum/. I redid a install and everything went fine.


<connectionStrings configSource="forum/db.config"/>
    <appSettings configSource="forum/app.config"/>
    <rewriter configSource="forum/URLRewriter.config"/>
    <system.net>
        <mailSettings>
            <smtp configSource="forum/mail.config"/>



Heres about the easiest way to set it up.

In VS create new website - choose empty website in C:\YAF

Add folder named Forum

Unzip YAF download to C:\YAF\Forum

Move APP_Code, Bin, app.config, mail.config, db.config,

URLrewriter.config and the Recommended_web.config to the root C:\YAF

Rename Recommended_web.config to web.config.

Set your password in app.config

<add key="YAF.ConfigPassword" value="Secret" />

Add/Uncomment in app.config

<add key="YAF.FileRoot" value="~/Forum"/> <-- May not need this as it seems to run ok without it

<add key="YAF.AppRoot" value="~/Forum" />

add new itew - sqldatabase, will create APP_DATA Folder

add db connection string to db.config

Set Forum/Default.aspx as startup page

Build and Run, Should work :roll:

I think thats it, Post up any errors as maybe I missed something.


test
Ganamede
  •  Ganamede
  • 53.6% (Neutral)
  • YAF Forumling Topic Starter
2010-03-01T15:47:10Z
I went through those exact steps and I get the same errors as described above. I'm not sure what else I can try, I may just have to find another forum solution. Thank you though for taking the time to try and help me out.
Ederon
2010-03-01T18:03:54Z
I shall find time for this tomorrow so if you let me help you, I'm sure we'll find solution.
When I post FP:Ederon in a topic, I'm leaving my footprint there so I can track it once I get into coding/supporting.
UserPostedImage 
davesters81
2010-03-02T00:43:29Z
I was having the same problems as I am a new user to YAF and trying to get her running in a /forums sub-dir.

One thing that got rid of all those class errors. When I moved the 'Bin' directory to the root folder, there is still a 'Net 3.5' inside the 'Bin' folder. I copied everything from the 'Net 3.5' folder right into the 'Bin' folder, and those errors went away. Maybe try that and see if it fixes anything.

Now I am dealing with a new error, but still messing around with it. I will let you know if I come across anything else.
davesters81
2010-03-02T01:18:20Z
I used this link here as a reference:

http://wiki.yetanotherforum.net/embeddedYaf.ashx 

All I did was use the yaf provided web-config file. I added my websites sql database connection strings, and modified the one for yaf to a new database I created for it.

Copied the app.config, db.config, mail.config, Bin folder (with the change as in my post above), and the App-Code folder to my root website folder.

In app.config, change the two keys as in logan's post above.

in new web.config file, delete all references to urlwriter.config. This appears to not be necessary when adding YAF to an existing website.

Now everything works perfectly on my local development server. Now to try it on the web server. I will post anything else new, but that seemed to fix it for me.
Ganamede
  •  Ganamede
  • 53.6% (Neutral)
  • YAF Forumling Topic Starter
2010-03-02T02:54:37Z
Thanks for continuing to help me guys. I'll try your ideas tomorrow davesters and post my results.
Ganamede
  •  Ganamede
  • 53.6% (Neutral)
  • YAF Forumling Topic Starter
2010-03-02T23:03:55Z
Ok, I tried copying the contents of the 3.5 folder over and removed references to urlwriter.config. I'm still not able to compile.

I'll describe a little clearer what seems to be happening. Every control or element with a runat="server" and an id that is named in the .ascx control file is not being recognized in the .cs code behind. I tried opening a control and typing in my own server div tag like:
<div runat="server" id="testdiv"></div> but it was not recognized in the codebehind. I then put in the absolute path in the top directive for the CodeFile="~/forum/controls/xxx.ascx.cs" and then the controls for that page were recognized in the code file. I still get an error for it, but now its giving errors based on definitions and incorrect arguments instead of "does not exist in current context" like it did before I put the absolute path in.

I did some googling and found an article http://weblogs.sqlteam.c...ve/2009/02/21/60848.aspx .
It describes codebehind vs codefile which is exhibiting the same symptoms of my project.

Does any of this give anyone a suggestion as to what's going on? It appears as though there is a missing connection. I haven't even been able to get to the point where the settings and placement of my config files is even relevant.

Is there any other information or settings I can give that might help you diagnose the problem?

Thanks again.
kbabinsom
2010-03-09T00:37:11Z
Ganamede wrote:

Hello everyone. I've spent a lot of time trying to get YAF v1.9.4-RC-1 to work when installed in a sub directory. I have gone through every suggestion in this forum and searched the web but I can't get it to work. I'm going to post the steps I've taken and I really hope someone can spot what I'm doing wrong. I have managed to get it working when installing YAF in the root directory, but not the sub directory. Thanks in advance.



Ganamede,

This is a symptom of trying to use the YAF aspx / ascx files in a web application instead of a web site.

The difference being that web application aspx / ascx files have an accompanying designer.cs file with each of them. In a web site project, there are no designer files.

The way to resolve all 2400 or whatever errors (believe me, I got the EXACT same number of errors so I know I was experiencing your same issue) is to right-click on your "forum" sub-folder (or wherever you put yaf) in visual studio and select "Convert to Web Application". I just finished doing that and rebuilt successfully.

Hope this helps!

Cheers,
Kevin
Ganamede
  •  Ganamede
  • 53.6% (Neutral)
  • YAF Forumling Topic Starter
2010-03-24T21:18:02Z
Thanks kbabinsom! Thats exactly what was happening. Sorry for the delay, I got so frustrated there I stopped working on the project. I'm still not out of the water, I have a few other errors, but I'll try tackling those myself before posting agagin. I REALLY appreciate your help!!
opaz
  •  opaz
  • 51.2% (Neutral)
  • YAF Forumling
2010-04-19T09:39:49Z
I have done all things in this thread but I am getting this error:

Could not load file or assembly 'YAF' or one of its dependencies. The system cannot find the file specified.

Could someone please help me out here?

I am using ASP.NET 4.0 and YAF v1.9.4-RC-1
opaz
  •  opaz
  • 51.2% (Neutral)
  • YAF Forumling
2010-04-19T10:49:52Z
Me again,

I was just thinking if it is easier to include YAF as a project in my current solution and in someway reference the forum into my current web application.

If so, does anyone know how?

About Us

The YAF.NET is an open source .NET forum project. YAF.NET is supported by an team of international developers who are build community by building community software.

Powered by Resharper Donate with PayPal button

Project Twitter Updates

Copyright © YetAnotherForum.NET & Ingo Herbote. All rights reserved