Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

We have a parent website and have separate virtual directories under it. The parent website points to a ASP.NET web app and all the virtual directories point to a common ASP.NET web app. The parent website an the virtual directory share one common app pool.

The code in the virtual directories access the web.config of the parent website. However, intermittently one virtual directory cant find the web.config of the parent website throwing error. This intermittent issue happens for one virtual directory at random but at the same time doesn't happen with others. I compared the metabase configuration file for virtual directories and they are same. The only workaround for this to recycle the app pool which would affect the virtual directories having no issues. Could somebody have any idea on why the virtual directory cant access web.config of the main website?

Code :-

 string MembershipProvierName = (WebConfigurationManager.GetSection(MembershipSectionKey) as MembershipSection).DefaultProvider;

Error (when It tries to get a section from the web.config )

Stack Trace :

   at System.Web.CachedPathData.GetPhysicalPath(VirtualPath virtualPath)
   at System.Web.CachedPathData.GetConfigPathData(String configPath)
   at System.Web.HttpContext.GetFilePathData()
   at System.Web.HttpContext.GetSection(String sectionName)
share|improve this question
    
What exactly is the error message when the virtual directory can't find the web.config? Anything in the http or Windows event logs? –  Peter Hahndorf Jun 6 '12 at 16:56
    
Peter - please see the updated question –  Ashish Gupta Jun 6 '12 at 17:02
    
We are having this exact same problem now. Did you have any luck resolving it? –  Chris May Feb 26 '13 at 14:15
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.