繁体   English   中英

WCF服务。 无法在IIS7中托管

[英]WCF Service. Can't host in IIS7

我有一个非常简单的WCF服务,我正在尝试将其托管在本地IIS中。 我一直都收到此错误:

HTTP Error 404.0 - Not Found
The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.

我试图将“应用程序池”更改为“经典”,但仍然无法正常工作。 我尝试了一堆其他网站,但没有成功。

任何人都可以帮忙。

更新1:

我在bin文件夹中有我的dll和pdb文件,并且我有这样的web.config:

<configuration>
    <system.web>
      <compilation debug="false" targetFramework="4.5" />
      <httpRuntime targetFramework="4.5" />
    </system.web>
  <system.serviceModel>
    <serviceHostingEnvironment>
      <serviceActivations>
        <add factory="System.ServiceModel.Activation.ServiceHostFactory" relativeAddress="./HelloWorldService.svc" service="MyWCFServices.HelloWorldService" />
      </serviceActivations>
    </serviceHostingEnvironment>
    <behaviors>
      <serviceBehaviors>
        <behavior>
          <serviceMetadata httpGetEnabled="true" />
        </behavior>
      </serviceBehaviors>
    </behaviors>
  </system.serviceModel>
</configuration>

然后在IIS中添加一个新项目,显示包含dll的文件夹的路径。 转到以下链接时出现错误: http://mycomputername/HelloWorldService/HelloWorldService.svc.

更新2:

在我的计算机上,.NET 3.5.1功能已关闭。 我打开了 然后我得到了这个错误: 在此处输入图片说明 然后我将应用程序池中的.net版本更改为4.0.30319。 这些更改后仍然存在相同的错误:

HTTP Error 404.0 - Not Found
The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.

根据评论链:

在服务器级别的IIS,ISAPI和CGI限制中,您需要启用v4。

如果没有v4,则需要使用IIS安装/注册ASP.NET v4:

c:\windows\microsoft.net\framework\v4.0.30319\aspnet_regiis.exe -i

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM