我一直在尝试将WCF服务部署到IIS 5.1。我在这里找到了this的答案 - 这似乎是同一个问题;然而,我遵循这个时候,然后尝试浏览到服务页面,我得到以下错误:在IIS 5.1上部署WCF服务
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...
我在IIS中创建一个虚拟目录,并指着我的解决方案文件夹中的子目录 - 和我正在发布到虚拟目录。
我的web.config文件服务节点看起来是这样的:
<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
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>
这编译和VS2008的时候运行下运行正常。任何人都可以向我指出正确的方向吗?
没有App_Code目录,但用〜/ MyService.svc.cs替换MyService.svc.cs没有任何区别 – 2011-01-28 13:32:40