Debugging a WCF service on Windows 7 and IIS 7

I created and deployed a WCF service, created with Microsoft Visual Studio 2008, to IIS 7 on Windows 7 and I got the error message:
Unable to start debugging on the web server. Could not start ASP .NET debugging. More Information may be available by starting the project without debugging.

image

So I did, I started the WCF service without debugging an got the error page:
HTTP Error 404.3 – Not Found
The page you are requesting cannot be served because of the extension configuration. If the page is a script, add a handler. If the file should be downloaded, add a MIME map.

Then I followed the instruction on http://blogs.msdn.com/rjohri/archive/2009/06/29/the-page-you-are-requesting-cannot-be-served-because-of-the-extension-configuration.aspx
, that cleared the error!

  • Run Visual Studio 2008 Command Prompt as “Administrator”.
  • Navigate to C:\Windows\Microsoft.NET\Framework\v3.0\Windows Communication Foundation.
  • Run this command servicemodelreg –i
  •  

    Installed IIS 7 after installing Visual Studio 2008 and .NET Framework 3.5

    WCF exception: Security settings for this service require 'Anonymous' Authentication but it is not enabled for the IIS application that hosts this service.

    Security settings for this service require ‘Anonymous’ Authentication but it is not enabled for the IIS application that hosts this service.

    image

    This error occurred, because I had an endpoint configured in mine wcf service web.config with a identity tag, as shown below:

    <endpoint address="" binding="wsHttpBinding" contract="Tpp.Pegaso.MaintenanceService.IMaintenanceService">
        <identity>
            <dns value="localhost"/>
        </identity>
    </endpoint>

    This identity element should be removed or replaced to reflect the identity under which the deployed service runs. If removed, WCF will infer an appropriate identity automatically.

    To avoid disclosing metadata information, I set the serviceMetadata httpGetEnabled to false:

    <serviceMetadata httpGetEnabled="true"/>

    and removed the mex endpoint:

    <endpointaddress="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>