C# WCF赢得';IIS中的t主机

C# WCF赢得';IIS中的t主机,c#,wcf,iis,C#,Wcf,Iis,我已将我的服务创建为WCF服务应用程序。然后,我将该服务发布到一个名为“TestService”的文件夹中。我正在尝试将其作为站点添加到IIS管理器。在我浏览到我经常使用的服务之前,一切似乎都很顺利: HTTP Error 403.14 - Forbidden The Web server is configured to not list the contents of this directory. 我正在浏览此网站,该网站位于IIS的8734端口。web.config还具有以下功能: &

我已将我的服务创建为WCF服务应用程序。然后,我将该服务发布到一个名为“TestService”的文件夹中。我正在尝试将其作为站点添加到IIS管理器。在我浏览到我经常使用的服务之前,一切似乎都很顺利:

HTTP Error 403.14 - Forbidden
The Web server is configured to not list the contents of this directory.
我正在浏览此网站,该网站位于IIS的8734端口。web.config还具有以下功能:

<service behaviorConfiguration="TestServiceBehavior" name="TestApp.Service.TestService">
<endpoint address="/Authentication" binding="wsHttpBinding" bindingConfiguration="TestServiceBinding"
      contract="TestApp.Service.IAuthenticationService" />

// ... other endpoints

<host>
  <baseAddresses>
    <add baseAddress="http://localhost:8734/Design_Time_Addresses/TestApp.Service/Service1/" />
  </baseAddresses>
</host>

// ... 其他端点


任何帮助都将不胜感激。

服务是托管的,您需要浏览到服务端点,例如
http://localhost:8734/MyService.svc
。您得到403的原因是您试图浏览应用程序部署的目录,这通常是不允许的。您可以使用.

打开目录浏览。通过发布服务创建的svc文件名为TestApp.service.TestService.svc,如果我尝试导航到I get HTTP Error 404.3-Not Found,您需要使用svc文件相对于根目录的路径。您的web.config中的基址设置可用于更改此设置。有关于如何正确使用基址的答案。