YAFLogo

Lac
  • Lac
  • 89.600006% (Honored)
  • YAF Forumling Topic Starter
15 years ago
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
15 years ago
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
  • mddubs
  • 100% (Exalted)
  • YAF Developer
15 years ago
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.600006% (Honored)
  • YAF Forumling Topic Starter
15 years ago
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
15 years ago
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
  • mddubs
  • 100% (Exalted)
  • YAF Developer
15 years ago
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
  • mddubs
  • 100% (Exalted)
  • YAF Developer
15 years ago
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
  • mddubs
  • 100% (Exalted)
  • YAF Developer
15 years ago
The final solution to using multiple boards is here:

http://forum.yetanotherforum.net/yaf_postst7931_Multiboards-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
15 years ago

The final solution to using multiple boards is here:

http://forum.yetanotherforum.net/yaf_postst7931_Multiboards-are-working.aspx 

mddubs wrote:

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
15 years ago

The final solution to using multiple boards is here:

http://forum.yetanotherforum.net/yaf_postst7931_Multiboards-are-working.aspx 

skylineiz wrote:

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 ?

mddubs wrote:

Yeah, you don't have access to the forum developer section. mddubs -- could you repost in an accessible forum?

mddubs
  • mddubs
  • 100% (Exalted)
  • YAF Developer
15 years ago
No problem.

http://forum.yetanotherforum.net/yaf_postsm35195_Multiple-Boards-Multiboards-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 🙂 )