Monday, November 11, 2013

FileNotFoundException while using Microsoft.Web.Administration

I recently ran into an issue while attempting to create a C# assembly that was using the Microsoft.Web.Administration namespace.

Whenever I attempted to execute my C# code, I would receive the following exception:


Well, the exception made no sense whatsoever, so I ended up doing a little bit of digging.

The first thing I discovered was that there were 2 versions of the Microsoft.Web.Administration assembly in the GAC:


When I originally selected the Assembly Reference in SharpDevelop, I selected the default version:


However, when I checked the checkbox for "Choose specific assembly version", I noticed the following:


After discussing this with Microsoft Support, I discovered that the different version of Microsoft.Web.Administration (v. 7.9.0.0) ships with IIS Express!

The official version of Microsoft.Web.Administration that is associated with the full version of IIS is v. 7.0.0.0 and is located at this file path: C:\Windows\system32\inetsrv\Microsoft.Web.Administration.dll

Therefore, when I changed my Assembly Reference to v. 7.0.0.0 and executed my C# code once again, I was able to successfully configure my IIS installation!

No comments:

Post a Comment