Web.config merge with Yetanotherforum?

Topics: ASP.NET 2.0
Nov 9, 2007 at 1:22 PM
Hi friends,
I am going to use BE with a forum software called yetanotherforum.The problem is that i can not merge the two web.configs.both are in asp.net 2 and C#.can anyone help?

tx

Web.config for YAF:
-------------------------
<?xml version="1.0"?>
<configuration>
<configSections>
<section name="yafnet" type="yaf.SectionHandler,yaf"/>
<section name="rewriter" type="Intelligencia.UrlRewriter.Configuration.RewriterConfigurationSectionHandler, Intelligencia.UrlRewriter" />
</configSections>

<yafnet configSource="yafnet.config"/>
<rewriter configSource="urlrewriter.config"/>

<system.web>
<httpModules>
<add type="Intelligencia.UrlRewriter.RewriterHttpModule,Intelligencia.UrlRewriter" name="UrlRewriter" />
</httpModules>
<globalization requestEncoding="utf-8" responseEncoding="utf-8"/>
<compilation defaultLanguage="c#" debug="false"/>
<pages enableEventValidation="false" validateRequest="false" smartNavigation="false"/>
<authentication mode="Forms">
<forms name=".YAFNET_Authentication" timeout="525600" />
</authentication>
<customErrors defaultRedirect="error.aspx" mode="RemoteOnly"/>
<!--trace enabled="true" pageOutput="true"/-->
<xhtmlConformance mode="Legacy"/></system.web>
</configuration>
Nov 10, 2007 at 5:20 AM
any idea?
Dec 18, 2007 at 8:02 PM
Did you ever get this working? I would be interested in the results.
Dec 19, 2007 at 7:51 AM
I got that working (here http://www.campofchampions.com/blog.aspx). The site just launched so it's not perfect, but that's not because of the config stuff. Anyway, you will see both YAF and BE there. Within the same site navigation stuff. The BE is hacked into an iFrame because I couldn't "reach out" of its application to use my own master pages etc.

I'm not sure what your specific issue is. Bascially I run BE as an application, but YAF will run without that stuff (much easier). So you have to stick the small number of YAF config lines in your main site's web.config. Get that working and all that. Then with the BE thing, set it up as per the instructions, then watch the config.sys errors come up. From memory you have to "clear" the various settings which come up with errors until it's done.

I'm about to get serious with some snow or I'd have more time to explain. Mail me separately if you can't figure it out and I may have time to dig something out.


Dec 19, 2007 at 7:18 PM
Hope you got your snow issue resolved...we had one over the weekend here in St. Louis. I have an issue I cannot seem to get any clear direction on...seems to involve conflicting web.config, or assemblies or something....anyway, my BE runs near perfect under a 'typical' asp.net 2.0 site built in VS C#. It is running under the root site in a virtual. Problem is, I want to run it under my actual site which is a composite web type site created in VS C# using Web Client Software Factory. When I point a new virtual at the same BE, it blows on the root web config. I can remove the lines in the error but the error just keeps moving around in my web.config... appreciate any help offered as I really think the BE is a great little tool...but cant seem to get it integrated into my more contemporary web site design.
Thanks


philw wrote:
I got that working (here http://www.campofchampions.com/blog.aspx). The site just launched so it's not perfect, but that's not because of the config stuff. Anyway, you will see both YAF and BE there. Within the same site navigation stuff. The BE is hacked into an iFrame because I couldn't "reach out" of its application to use my own master pages etc.

I'm not sure what your specific issue is. Bascially I run BE as an application, but YAF will run without that stuff (much easier). So you have to stick the small number of YAF config lines in your main site's web.config. Get that working and all that. Then with the BE thing, set it up as per the instructions, then watch the config.sys errors come up. From memory you have to "clear" the various settings which come up with errors until it's done.

I'm about to get serious with some snow or I'd have more time to explain. Mail me separately if you can't figure it out and I may have time to dig something out.




Dec 20, 2007 at 3:07 AM
I'm trying to do the sam thing! Here is a problem that you may run into.....

in Settings.aspx.cs line: 258 I made the following change

foreach (string file in Directory.GetFiles(path))
to
foreach (string file in Directory.GetFiles(path, "*.resx"))

the reason being YAF has various files in the folder as well as my VSS file *.scc which cause an exception when trying to load them.
Dec 20, 2007 at 7:07 AM
Hi
I was not able to use both in the same application pool.Looks like you have done it.would you give me the instructions?

tx
Dec 20, 2007 at 11:39 AM
I don't understand the "application pool" business, but I did find that BE particularly was snotty if you just used the default one. Sometimes, on some versions of IIS it would work, on others it would fail erratically. So I got bored with it and I just create a separate pool for each BE installation on each server. Then I make BE use that and it seems ok. I'd be delighted if some one posts to explain what precisely this is all about, but if you have trouble on that, then try what I just said.

If you have problems with the web.configs, then it's best to post precisely what the error is then we can kick them down for you one by one. Typically what I would get, would be that the thing would barf on something like the XmlMembershipProvider (which I'm not using, but there it is). To fix that you just add <clear /> at the start of that list, which seems to remove all the other things in there which were conflicting with the BE stuff. So that's your general fix: look for an error, then find the section which is causing it, then put a "clear" in at the top of that section (which presumably zaps anything from machine.config or the main web.config, and leaves the field free for BE to do its business). It works for me.
Dec 20, 2007 at 1:45 PM
Seems I have progressed in that I have a different error message...'That assembly does not allow partially trusted callers' I added the <clear /> in the list (actually only one item) and the error didnt' change

Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

Parser Error Message: That assembly does not allow partially trusted callers.

Source Error:


Line 110: <providers>
Line 111: <clear />
Line 112: <add name="DefaultSiteMapProvider" type="Microsoft.Practices.CompositeWeb.Providers.ModuleSiteMapProvider, Microsoft.Practices.CompositeWeb" securityTrimmingEnabled="true"/>
Line 113: </providers>
Line 114: </siteMap>


Source File: D:\www-ecollaboration.com\web.config Line: 112


--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.832; ASP.NET Version:2.0.50727.832

Is this just a code security issue? I have looked at info on how to sign and strongly name an assembly...is this saying that the BE is not strongly named and therefore cannot access the compositeweb assembly, or is he saying the compositeweb assembly is not strongly typed ? Sorry, I am not too strong in this area but know it is important, likewise don't know if this is where I can resolve the problem of getting the BE to run under this web site.
Thanks.
John


philw wrote:
I don't understand the "application pool" business, but I did find that BE particularly was snotty if you just used the default one. Sometimes, on some versions of IIS it would work, on others it would fail erratically. So I got bored with it and I just create a separate pool for each BE installation on each server. Then I make BE use that and it seems ok. I'd be delighted if some one posts to explain what precisely this is all about, but if you have trouble on that, then try what I just said.

If you have problems with the web.configs, then it's best to post precisely what the error is then we can kick them down for you one by one. Typically what I would get, would be that the thing would barf on something like the XmlMembershipProvider (which I'm not using, but there it is). To fix that you just add <clear /> at the start of that list, which seems to remove all the other things in there which were conflicting with the BE stuff. So that's your general fix: look for an error, then find the section which is causing it, then put a "clear" in at the top of that section (which presumably zaps anything from machine.config or the main web.config, and leaves the field free for BE to do its business). It works for me.


Dec 20, 2007 at 3:25 PM
I do have both YAF and BE running in my dev environment however I am not done yet. I want BE to use SQL and have yet to set that up. Once done I'll post my results. May take a couple of days though.
Thanks,
Dylan
Dec 20, 2007 at 3:53 PM
I needed the clear on the site map provider *** in the BE.net web.config, not in my "parent" site provider config file (looks like you have it the other way around?

So in the site's root web.config I have (ok, I have a bunch of stuff, but you get the idea):
<siteMap defaultProvider="TotalXmlSiteMapProvider">
<providers>
<add name="TotalXmlSiteMapProvider" type="System.Web.XmlSiteMapProvider" siteMapFile="~/Web.sitemap"/>
<add name="BottomXmlSiteMapProvider" type="System.Web.XmlSiteMapProvider" siteMapFile="~/bottom.sitemap"/>
<add name="FileSystemSiteMapProvider" type="FileSystemSiteMapProvider"/>
</providers>
</siteMap>

Then in the BE web.config I have:
<siteMap defaultProvider="PageSiteMap" enabled="true" >
<providers>
<clear />
<add name="PageSiteMap" description="The site map provider that reads in the .sitemap XML files." type="BlogEngine.Core.Web.Controls.PageSiteMap"/>
<add name="SecuritySiteMap" description="Used for authenticated users." type="System.Web.XmlSiteMapProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" securityTrimmingEnabled="true" siteMapFile="web.sitemap" />
</providers>
</siteMap>

So the clear needs to be for BE. I think what happens is that IIS processes the machine.config, then the site's "root" web.config, then it gets to the application-level one for BE last. So you have to clear the other stuff out of there, or BE barfs at you. So the "clear" words need to be all in the BE file, and I just stuck mine in one by one until the errors went away.

That said, your error seems to be about trust levels, which is a different kettle of fish. What's a "partially trusted caller"... one who doesn't have a high enough trust level? What trust level do you have there?

I just hacked at mine until it worked, hence I don't really know the precise fix. I'm using SQL for both YAF and BE, although BE was on XML to start with and that worked also.
Dec 20, 2007 at 8:31 PM
Thanks for the response... my error is in the root web.config....so don't know where to begin in <clear /> in the BE web.config ? Trust level is 'Full' so should be accessible to all?? But ahhh I'm a lyin to myself...just confirmed the BE web.config had Trust set to 'High' and not 'Full;...after I changed that, the BE came to life on the new site woo hoo....my CSS is a little whacked but I can fix that woo hooooo!
But is does beg the question....why did it originially work on my standard asp.net 2.0 site which does not use compositeweb ? But that...is another story.

Thanks again!!


philw wrote:
I needed the clear on the site map provider *** in the BE.net web.config, not in my "parent" site provider config file (looks like you have it the other way around?

So in the site's root web.config I have (ok, I have a bunch of stuff, but you get the idea):
<siteMap defaultProvider="TotalXmlSiteMapProvider">
<providers>
<add name="TotalXmlSiteMapProvider" type="System.Web.XmlSiteMapProvider" siteMapFile="~/Web.sitemap"/>
<add name="BottomXmlSiteMapProvider" type="System.Web.XmlSiteMapProvider" siteMapFile="~/bottom.sitemap"/>
<add name="FileSystemSiteMapProvider" type="FileSystemSiteMapProvider"/>
</providers>
</siteMap>

Then in the BE web.config I have:
<siteMap defaultProvider="PageSiteMap" enabled="true" >
<providers>
<clear />
<add name="PageSiteMap" description="The site map provider that reads in the .sitemap XML files." type="BlogEngine.Core.Web.Controls.PageSiteMap"/>
<add name="SecuritySiteMap" description="Used for authenticated users." type="System.Web.XmlSiteMapProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" securityTrimmingEnabled="true" siteMapFile="web.sitemap" />
</providers>
</siteMap>

So the clear needs to be for BE. I think what happens is that IIS processes the machine.config, then the site's "root" web.config, then it gets to the application-level one for BE last. So you have to clear the other stuff out of there, or BE barfs at you. So the "clear" words need to be all in the BE file, and I just stuck mine in one by one until the errors went away.

That said, your error seems to be about trust levels, which is a different kettle of fish. What's a "partially trusted caller"... one who doesn't have a high enough trust level? What trust level do you have there?

I just hacked at mine until it worked, hence I don't really know the precise fix. I'm using SQL for both YAF and BE, although BE was on XML to start with and that worked also.