Microsoft.Web.Administration of IIS Express

I blogged about Microsoft.Web.Administration a long while ago, but intentionally I left a small topic aside. However, it remains a misery sometimes painful to developers, so here comes a dedicated post.

Version in Global Assembly Cache

If you plan to write a .NET Framework application to consume Microsoft.Web.Administration API, you probably notice that Visual Studio resolves that reference to an assembly in GAC,

img-description Figure 1: Microsoft.Web.Administration in full IIS.

This version appears in GAC, as long as you enable full IIS on this Windows machine.

Version in Global Assembly Cache

The version worked pretty fine for years, but suddenly things started to break. For example, if you don’t force the reference in your project file to this specific version, you might find that Visual Studio/MSBuild resolves a version of from GAC instead.

  • Where does this version come from?

    Well, it is part of IIS Express installation.

  • Does it bring any harm?

    This assembly by default reads/writes the IIS Express configuration file, so your code suddenly behaves differently (not against full IIS any more).


Since you probably don’t want to uninstall IIS Express (you might need it some day), the remaining option at compile time to resolve the issues is to force your application to use version as reference explicitly.

And then use assembly redirection in app.config (or web.config) to load only version at runtime.

But if your web app is being hosted on IIS Express, you might need further changes to IIS Express specific aspnet.config.

© Lex Li. All rights reserved. The code included is licensed under CC BY 4.0 unless otherwise noted.

© - Lex Li. All rights reserved.

Using the Chirpy theme for Jekyll.

Last updated on June 24, 2024