This error ("Failed to access IIS metabase") can occur when you try to access your WCF when you have added for hosting within IIS.
To solve this problem do this:
- Reregister ASP.NET for IIS: Open an Visual Studio Command Prompt (or a regular command prompt and cd into the .Net dir - usually: C:\WINNT\Microsoft.NET\Framework\v2.0.50727) then type:
aspnet_regiis -i
- When complete, from the same command prompt run: iisreset
Verify your IIS virtual/app dir is setup correctly (uses .Net 2). If you don't already have one...
To Host a WCF Service within IIS:
- Develop your service in IIS (I'm not going to tell you how to do that!) and build it.
- Within your computer management/MMC console (compmgmt.msc), open the Internet Information Service node and right click on the site you want to use and select New - Virtual Directory...
- Enter the name you want.
- Point this to the directory you created your WCF service project in (the project root dir - not the bin dir).
- Complete the wizard then back in the MMC window right click on your new virtual dir and select Properties.
- On the ASP.NET tab make sure uses version 2.0.50727 (or whatever your v2 is).
To test: within the MMC console - open your new virtual dir, right click on one of your services (eg MyService.svc) and select Browse.
HTH
Tim