VS 2012无法启动Web服务

时间:2012-11-09 11:07:03

标签: asp.net web-services debugging visual-studio-2012

问题是,文件丢失了,请参阅下面的评论。问题解决了。

我从VS 2010迁移到VS 2012。

从那时起,当我启动一个也有Web服务的Web项目时,Web服务就再也无法访问了。它在VS 2010中很好用,也适用于IIS服务器。

当我尝试访问server / MyComService.svc上的web服务时,我收到404错误,说“无法找到资源。”

网页本身就像预期的那样。

以下是web.config中服务的定义,但由于它适用于VS 2010和IIS服务器,因此无法认为其中存在错误:

    <system.serviceModel>
    <services>
      <service name="MyComService" behaviorConfiguration="WebServiceBehaviour" >
        <endpoint address="" binding="basicHttpBinding" bindingConfiguration="WebServiceBinding" contract="MyComServiceInterface">
        </endpoint>
      </service>
    </services>
    <bindings>
      <basicHttpBinding>
        <binding name="WebServiceBinding" maxReceivedMessageSize="4000000">
          <readerQuotas maxStringContentLength="4000000" maxBytesPerRead="4000000" maxArrayLength="4000000" />
          <security mode="None"/>
        </binding>
      </basicHttpBinding>
    </bindings>
    <behaviors>
      <serviceBehaviors>
        <behavior name="WebServiceBehaviour">
          <serviceMetadata httpGetEnabled="true" />
          <serviceDebug includeExceptionDetailInFaults="true" />
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
  </system.serviceModel>

我也试过设置端点的地址属性,但它仍然不起作用。

我需要更改设置中的任何内容,或者如何让VS2012启动网络服务?

提前致谢。

1 个答案:

答案 0 :(得分:0)

我根据以下信息尝试了不同的东西。

 Check to see if you have received the following update? http://support.microsoft.com/kb/894670