【问题标题】:Cannot open svc file with wcfTestClient.exe无法使用 wcfTestClient.exe 打开 svc 文件
【发布时间】:2012-04-25 11:28:19
【问题描述】:

我刚刚将 wcf 服务添加到我的网站。 web.config 看起来像这样:

<system.serviceModel>
<services>
  <service name="Realstuf.Service">

    <host>
      <baseAddresses>
        <add baseAddress = "http://ismyrealstuff/Services/" />
      </baseAddresses>
    </host>

    <!-- Service Endpoints -->
    <endpoint address ="http://ismyrealstuff/Services/Service.svc" binding="wsHttpBinding" contract="Realstuf.IService" behaviorConfiguration="FirstServiceBehaviour"/>

    <!-- Metadata Endpoints -->
    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
  </service>
</services>
    <behaviors>
        <serviceBehaviors>
            <behavior name="FirstServiceBehaviour">
                <serviceMetadata httpGetEnabled="true" />
                <serviceDebug includeExceptionDetailInFaults="false" />
            </behavior>
        </serviceBehaviors>
    </behaviors>
    <serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
</system.serviceModel>

添加了一个svc文件,并在app_code目录下添加了service.cs和Iservice.cs文件。未找到 Assemblyinfo.cs 文件。

当我尝试在 wcftestclient 中打开 svc 文件时,出现“添加服务失败”错误。 错误详细信息说:

错误:无法读取 D:\Projects\IsMyRealStuf\IsMyRealStuffWeb\Services\Service.svc。无法将文件 D:\Projects\IsMyRealStuf\IsMyRealStuffWeb\Services\Service.svc 作为程序集加载。查看 FusionLogs 了解更多信息。无法加载文件或程序集 'file:///D:\Projects\IsMyRealStuf\IsMyRealStuffWeb\Services\Service.svc' 或其依赖项之一。该模块应包含程序集清单。

如果我添加任何 assemblyinfo.cs 文件,是否可以解决此问题?那么如何呢?

【问题讨论】:

    标签: wcf visual-studio-2010 web-services


    【解决方案1】:

    http://ismyrealstuff/Services/Service.svc 添加为服务,而不是磁盘上的文件。

    【讨论】:

      猜你喜欢
      • 2019-01-06
      • 2010-12-17
      • 2020-12-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多