Lac
  •  Lac
  • 89.60001% (Honored)
  • YAF Forumling Topic Starter
2009-02-25T23:26:48Z
When i run two forums in one application i found the foliwing error.

The situation:
*) One App
*) Forum at /Forum/
*) Forum at /Projects/
*) Every three directory has in own web.config - one in / directory with connection string etc, and two in folders with app settings like BoardId and BaseUrl.

Parameter BaseUrl from config was cached incorrectly: it was mined on forum what first started and remembered for all instances. If i first start /Projects/ for example, all links in /Forum/ have /projects/ in path also, but this wrong.

i fix it by editing UrlBuilder.cs, change property get to
		static public string BaseUrl
		{
			get
			{
                return WebConfigurationManager.AppSettings["BaseUrl"];
			}
		}
It works, but i think this wrong way becouse we lost cache and architecture when go away from YAF.Classes.Config.

After this change instances works fine.
Sponsor
Mek
  •  Mek
  • 100% (Exalted)
  • YAF Developer
2009-02-26T02:36:47Z
Matt a.k.a MDDUBS is also having the same/similiar issue; not an easy one to answer from what we've all attempted to look at; so please post back any findings...

UserPostedImage 

"It's a case of RTFM.. the only problem being we don't have a manual!"

When I post FP:Mek in a topic, I'm leaving my footprint there so I can track it once I get into coding/supporting. (Yes I stole this off Ederon 🙂 )
mddubs
2009-02-26T04:44:24Z
Thanks for the post Lac, glad you got your issue resolved. I'm going to test out your fix and hopefully it'll work for me too!!
UserPostedImage 
www.bunkerhollow.com  | www.careercomputing.com 
When I post fp:mddubs in a topic, I'm leaving my footprint there so I can track it once I get into coding/supporting. (Yes I stole this off Mek 🙂, who stole this off Ederon 🙂 )
Lac
  •  Lac
  • 89.60001% (Honored)
  • YAF Forumling Topic Starter
2009-02-26T07:19:57Z
I think one true architectural way is to separate cache storage for instances in one application. But this is hardway.
Mek
  •  Mek
  • 100% (Exalted)
  • YAF Developer
2009-02-26T08:13:22Z
Agreed, and its not a pleasent job.

UserPostedImage 

"It's a case of RTFM.. the only problem being we don't have a manual!"

When I post FP:Mek in a topic, I'm leaving my footprint there so I can track it once I get into coding/supporting. (Yes I stole this off Ederon 🙂 )
mddubs
2009-03-01T17:28:51Z
Woohoo!!! Thank you very much for this post Lac, my multiboards are working well now!

The BaseUrl now retrieves its value using the WebConfigurationManager from a dictionary cache using the HttpContext.Current.Request.FilePath as the key. I'm pretty sure all the existing functionality will remain the same, but going forward those who want to use multiboards from a single installation can do it like this:

Using Multiple Boards With A Single Installation

1. Install YAF as usual where-ever you choose, let's just say ~/forum1/ for simplicity.
2. For each new board, copy the default.aspx page to a new directory such as ~/forum2/.
3. Change the BoardID of the YAF:Forum control.
4. Add a web.config file to that directory (~/forum2/) and specify the appropriate BaseUrl key like this:
<?xml version="1.0"?>
<configuration>
  <appSettings>
    <add key="YAF.BaseUrl" value="~/forum2" />
  </appSettings>
</configuration>


I've committed the changes, Revision 2277 and 2278, and I've pushed it out to my production environment. So far so good!
UserPostedImage 
www.bunkerhollow.com  | www.careercomputing.com 
When I post fp:mddubs in a topic, I'm leaving my footprint there so I can track it once I get into coding/supporting. (Yes I stole this off Mek 🙂, who stole this off Ederon 🙂 )
mddubs
2009-03-01T18:26:33Z
Well... it fixed all the broken links in the admin page, but now the Post page is looking a little screwy.
UserPostedImage 
www.bunkerhollow.com  | www.careercomputing.com 
When I post fp:mddubs in a topic, I'm leaving my footprint there so I can track it once I get into coding/supporting. (Yes I stole this off Mek 🙂, who stole this off Ederon 🙂 )
mddubs
2009-06-14T05:39:12Z
The final solution to using multiple boards is here:
http://forum.yetanotherf...iboards-are-working.aspx 
UserPostedImage 
www.bunkerhollow.com  | www.careercomputing.com 
When I post fp:mddubs in a topic, I'm leaving my footprint there so I can track it once I get into coding/supporting. (Yes I stole this off Mek 🙂, who stole this off Ederon 🙂 )
skylineiz
2009-06-16T16:16:40Z
mddubs wrote:

The final solution to using multiple boards is here:
http://forum.yetanotherf...iboards-are-working.aspx 




im looking into multiboards too atm.
but i clicked on your link but it said i dont have access to view it :S
something i did wrong?

any chance i can see ?
Jaben
  •  Jaben
  • 100% (Exalted)
  • YAF Developer
2009-06-16T16:29:33Z
skylineiz wrote:

mddubs wrote:

The final solution to using multiple boards is here:
http://forum.yetanotherf...iboards-are-working.aspx 




im looking into multiboards too atm.
but i clicked on your link but it said i dont have access to view it :S
something i did wrong?

any chance i can see ?



Yeah, you don't have access to the forum developer section. mddubs -- could you repost in an accessible forum?
mddubs
2009-06-17T03:41:22Z
No problem.

http://forum.yetanotherf...ultiboards-Solution.aspx 
UserPostedImage 
www.bunkerhollow.com  | www.careercomputing.com 
When I post fp:mddubs in a topic, I'm leaving my footprint there so I can track it once I get into coding/supporting. (Yes I stole this off Mek 🙂, who stole this off Ederon 🙂 )

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