WCF workaround for WebMatrix Beta 1

IIS Developer Express Beta doesn’t work with WCF out-of-the-box. If you run a WCF application and browse to it, you will see the following error message:

“Could not load file or assembly 'Microsoft.Web.Administration, Version=7.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.”

This will be addressed in a forthcoming release. Meanwhile there are a couple of simple ways you can workaround this limitation.

Workaround 1: Copy assemblies to the app’s bin folder

Copy the following assemblies from the WebMatrix install location to your application’s bin directory.

  • Microsoft.Web.dll
  • Microsoft.Web.Administration.dll

By default, WebMatrix gets installed in  “%ProgramFiles%\Microsoft WebMatrix” or “%ProgramFiles(x86)%\Microsoft WebMatrix”, depending on your machine architecture.

Workaround 2: GAC the required assemblies

Installing the above assemblies in the GAC will work as well, but requires you to be an administrator. From an administrator prompt, switch to the WebMatrix install location. Then run the following commands:

gacutil /i Microsoft.Web.Administration.dll

gacutil /i Microsoft.Web.dll

One of the above workarounds will hopefully resolve the issue. If not, please let us know and we’ll be happy to investigate.

2 Comments

  • >> I am missing the assemblies Microsoft.Web.dll and microsoft.web.administration.dll on my computer.

    The workaround is no longer needed for IIS Express Beta 2 and beyond. The assemblies to run WCF will be automatically GAC'ed. Since you have IIS Express Beta 3 (installed by WebMatrix Beta 3), you should be good to go.

  • Yes, that is one of the limitations of xcopy. Since WCF requires MWA.dll, your only workaround is to manually GAC the dll.

Comments have been disabled for this content.