无法找到ServiceHost指令中的Service属性值

时间:2013-12-28 22:54:16

标签: c# wcf

好的,我花了一天时间查看这个错误并重新发布了所有帖子,但我仍然无法找到我出错的地方。我可以从外部Web服务客户端与Web服务查找进行通信,但我无法从VS或IIS中浏览.svc文件。我将发布到IIS 6服务器.NET 4.0上的映射驱动器。

非常感谢任何帮助。

的Web.config

<services>
      <service name="BiteSizeLearningWS.TranscriptService">

        <endpoint address=""
                  binding="wsHttpBinding"
                  contract="BiteSizeLearningWS.iServiceInterface" />


      </service>
    </services>

    <serviceHostingEnvironment aspNetCompatibilityEnabled="true">
      </serviceHostingEnvironment>
      <standardEndpoints>
          <webHttpEndpoint>
              <standardEndpoint name="" helpEnabled="true" automaticFormatSelectionEnabled="false" defaultOutgoingResponseFormat="Json" faultExceptionEnabled="false"></standardEndpoint>
          </webHttpEndpoint>
      </standardEndpoints>
  </system.serviceModel>
 <system.webServer>
    <modules runAllManagedModulesForAllRequests="true"/>
  </system.webServer>

Service.svc

<%@ ServiceHost Service="BiteSizeLearningWS.TranscriptService" %>

IserviceInterface.cs

namespace BiteSizeLearningWS
{
    [ServiceContract]
    public interface iServiceInterface
    ...

1 个答案:

答案 0 :(得分:2)

解决。我的错误是实现服务接口的类名与我的svc文件中的服务名称不匹配。我没有意识到他们必须匹配。

即。 我的服务名称是:

<%@ ServiceHost Service="BiteSizeLearningWS.TranscriptService" %>

但我的实施是:

public class TranscriptServiceLibrary : iServiceInterface

而不是

public class TranscriptService : iServiceInterface

对不起,大家。我显然没有包含每个人确定问题所需的文件。感谢您的所有投入。

相关问题