none
Unable To Host WCF Service in IIS using XP SP3 and Visual Studio 2008 SP1

    Question

  • Hello,

    I am unable to host WCF Service in IIS using XP SP3 using Visual Studio 2008 SP1

    Configuration
    XP SP3
    IIS 5.1
    Visual Studio 2008 SP1
    HTTP WebSite using WCF Service Template

    Error When Browsing .svc file

    The XML page cannot be displayed

    Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later.


    A name was started with an invalid character. Error processing resource 'http://localhost/IISHostedService/Service.svc'. L...

    <%@ ServiceHost Language="C#" Debug="true" Service="Service" CodeBehind="~/App_Code/Service.cs" %>


    Error When Debugging .svc file
    Unable to start debugging on the web server. The server does not support ASP.NET or ATL applications. Click help for more information on how to enable debugging.

    When I click the Help button I get directed to http://msdn.microsoft.com/en-us/library/bztkys81.aspx entitled Error: ASP.NET Not Installed.

    However  ASP.NET is installed.  I have been debugging Visual Studio 2008 ASP.NET applications in IIS for a while now.  But just to make sure I followed the instructions and ran aspnet_regiis -i. Still does not work.

    I checked the IIS Metabase and .svc is a mapped file.

    IIS Logs
    #Software: Microsoft Internet Information Services 5.1
    #Version: 1.0
    #Date: 2009-02-17 15:50:26
    #Fields: time c-ip cs-method cs-uri-stem sc-status

    While debugging:
    15:50:26 127.0.0.1 DEBUG /IISHostedService/Service.svc 501

    While browsing:
    15:55:00 127.0.0.1 GET /IISHostedService/Service.svc 304

    501 Not Implemented
    304 Not Modified

    Can anyone provide any guidance as to what is causing the problem an how to fix it? As a side note, no CPT versions of WCF were ever on this PC.

    Thanks

    Tuesday, February 17, 2009 4:18 PM

Answers

  • Can you try removing the leading slash? I.e. -s:W3SVC/1/root. I believe you should also be able to get the entire server with -s:W3SVC.
    Monday, February 23, 2009 9:34 PM
    Moderator
  • I am not aware of having changed the script maps, but your suggestion fixed the problem:

    ServiceModelReg -s:W3SVC/1/root

    Thanks very much.  You were a great help.
    • Marked as answer by Mark Phillips Monday, February 23, 2009 10:02 PM
    • Unmarked as answer by Mark Phillips Monday, February 23, 2009 10:02 PM
    • Marked as answer by Mark Phillips Monday, February 23, 2009 10:04 PM
    Monday, February 23, 2009 10:01 PM

All replies

  • my guess is .svc is unknown to IIS and therefore not handed off to ASP.NET.

    run servicemodelreg.exe /i

    its in the Windows/Microsoft.NET/Framework/3.0/Windows Communication Foundation directory
    Richard Blewett, thinktecture - http://www.dotnetconsult.co.uk/weblog2
    Tuesday, February 17, 2009 4:44 PM
    Moderator
  • I just ran servicemodelreg.exe /i  

    No luck.  I am getting the same errors.

    Are there any other suggestion on what could be done to solve this issue? 

    Mark
    • Edited by Mark Phillips Thursday, February 19, 2009 7:24 PM Clarification
    Tuesday, February 17, 2009 5:14 PM
  • -> I am unable to host WCF Service in IIS using XP SP3 using Visual Studio 2008 SP1.

    Have you ever hosted WCF services successfully on this machine before updating to XP SP3 or Visual Studio 2008 SP1? I want to confirm if this issue only happens after you update your system.

    Thanks
    Another Paradigm Shift
    http://shevaspace.blogspot.com
    Friday, February 20, 2009 7:50 AM
  • Good question.
     
    I can't say for sure whether this problem began after updating XP to SP3 and/or updating Visual Studio 2008 to SP1. 

    Before updating, I was not using WCF for Hosting.  Instead, I added a WCF Service to an already existing ASP.NET AJAX site.  (Not in IIS, the Development Server)

    Things are working fine on the Development Server.

    Updated
    XP  SP3 - December 2008
    Visual Studio 2008 SP1 - February 13, 2009

    Thanks
    Friday, February 20, 2009 3:49 PM
  • Just a thought, is the Virtual Directory running ASP.NET 2 and not 1.1?
    Friday, February 20, 2009 7:25 PM
  • Unfortunately, it's running ASPN.NET v2.0.50727

    Good suggestion though, sometimes it's the silliest things that are the root of the problem.

    Thanks

    Friday, February 20, 2009 8:17 PM
  • If ServiceModelReg -i didn't fix the problem, I would guess that you have changed script maps below the root, so the root script maps aren't being inherited.

    You can either run:
    - ServiceModelReg -sn:<path-to-vdir>, to install scriptmaps in just one vdir, or
    - ServiceModelReg -s:/W3SVC/1/root to force a recursive install on the entire Default Web Site (increment 1 as appropraite if it's not the Default Web Site)

    Monday, February 23, 2009 7:41 PM
    Moderator
  • Thanks for your response.

    I ran:

    C:\WINDOWS\Microsoft.NET\Framework\v3.0\Windows Communication Foundation>ServiceModelReg -s:/W3SVC/1/root

    And am getting the following error:

    Error: The script map path 'IIS://localhost//W3SVC/1/root' is not valid.

    I am using the Default Web Site.  I also tried incrementing to -s:/W3SVC/2/root  and -s:/W3SVC/3/root
    and get similar "is not valid" messages.  I also tried using "webroot" instead of "root" since that is the name of the directory on the hardrive.

    Any idea what the issue is here?

    Mark

    Monday, February 23, 2009 9:25 PM
  • Can you try removing the leading slash? I.e. -s:W3SVC/1/root. I believe you should also be able to get the entire server with -s:W3SVC.
    Monday, February 23, 2009 9:34 PM
    Moderator
  • I am not aware of having changed the script maps, but your suggestion fixed the problem:

    ServiceModelReg -s:W3SVC/1/root

    Thanks very much.  You were a great help.
    • Marked as answer by Mark Phillips Monday, February 23, 2009 10:02 PM
    • Unmarked as answer by Mark Phillips Monday, February 23, 2009 10:02 PM
    • Marked as answer by Mark Phillips Monday, February 23, 2009 10:04 PM
    Monday, February 23, 2009 10:01 PM