NerdyHearn
Home
Blog

Contact
Mailing List

Software

Active Directory Products
Object Compare
Permission Compare

IPhone Products
Calls To Calendar
SMS To CSV
SMS To Gmail
Voicemail To Gmail

Sites
DocuTerminal
How Long For Me
My Music To Me
SaveMySerials
TypeCount

Blog
Twitter

NerdyHearn - Blog


<< Back To All Blogs

Resolving ASP.NET Web.Config Inheritance

Thursday, December 3rd, 2009

I recently came across an issue with the following error:

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

I received this error while deploying a custom ASP.NET application on top of our existing SharePoint installation, in the root of our SharePoint site.

After doing some digging, even though my ASP.NET application was a separate ASP.NET application, it still inherits from the root application, which is SharePoint, and in this case, we had Business Portal installed on SharePoint as well (which added Business Portal assemblies to the root SharePoint web.config). When my new application was created, the bin folder obviously did not have the BusinessFramework assemblies included, but was still inheriting the requirement from the parent web.config.

One obvious resolution was to copy Microsoft.BusinessFramework.dll and BusinessFramework.config to the bin folder of my new application, but this is both bad practice and is not the true resolution for our issue at hand.

You can, however, clear previous inherited HTTP modules in the application Web.config. So, in our custom ASP.NET application, I added the clear element at the top of the httpModules element such as follows:

<httpModules>
<clear />
...
</httpModules>

This will clear any previous inheritted ASP.NET HTTP Modules and eliminate the issue that we were running into.

As a side note, you can also add inheritInChildApplications="false" in the root web.config's location element which will also fix inheritance issues, but the problem with this is we have other applications which do require that SharePoint's web.config properly inherit. Hopefully in the next .NET edition Microsoft will add the ability for something like inheritFromParentApplication so that you can not inherit per child application, instead of making the parent not pass to all children.

Configin' Tom Out.

Tags

ASP.NET Howto

Related Blogs

Impersonating a user in ASP.NET
Validate a Windows Username and Password against Active Directory
Resolving Odd 5 Minute Timeout in HttpWebRequest.
Configuring ASP.NET (And SharePoint) to use SQL-based Sessions
Creating High Quality Images with C# and GDI

Comments

Currently no comments.

Add A Comment

Name:


URL:


Email Address: (not public, used to send notifications on further comments)


Comments:



Enter the text above, except for the 1st and last character:


NerdyHearn - Latest tech news relating to C#, ASP.NET, SharePoint, PHP, general development, and more. DocuTerminal - Online Filing Cabinet solution. Scan, search and archive your paper documents. SaveMySerials - Protect yourself from theft, fire, natural disasters and more by recording your serial numbers My Music To Me - Stream your subsonic music collection to your Sonos wireless system TypeCount - Count how often you type across different computers! ServrTrackr - Monitor your SSL certificates, website uptime, and DNS configurations