开发者

Deploying a WCF service on IIS 5.1

I have been trying to deploy a WCF service to IIS 5.1. I found this answer on here – which seems to be the same question; however, when I follow this, and then try to browse to the service page, I get the following error:

   A name was started with an invalid character. Error processing resource 'http://MyComputerName/MyService/MyService...
<%@ ServiceHost Language="C#" Debug="true" Service="ServiceNamespace.MyService" CodeBehind="MyService.sv...

I have created a virtual directory in IIS and pointed it to a subdirectory of my solution folder – and am publishing to the virtual directory.

My web.config services node looks like this:

    <services>
        <service name="ServiceNamespace.MyService" behaviorConfiguration="ServiceNamespace.MyService">
            <!-- Service Endpoints -->
            <endpoint address="" binding="basicHttpBinding" contract=" ServiceNamespace.IMyService">
                <!-- 
          Upon deployment, the following identity element should be removed or replaced to reflect the 
        开发者_C百科  identity under which the deployed service runs.  If removed, WCF will infer an appropriate identity 
          automatically.          
                <identity>
                    <dns value="localhost"/>
                </identity>
      -->
            </endpoint>
            <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
        </service>
    </services>

This compiles and runs fine when run under VS2008. Can anyone point me in the right direction on this, please?


I finally found the answer. The Application under IIS was configured to use ASP.NET 1.1. I changed it to 2.0 and it worked fine.


The code behind path doesn't look right, I think it should be a relative path so:

CodeBehind="~/App_Code/YourServiceClass.cs"


Check that your code behind file is pointing to a cs file, it looks like it is pointing to a svc file.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜