【问题标题】:Webservice .Net 4.0 publishing problems in IIS7IIS7 中的 Webservice .Net 4.0 发布问题
【发布时间】:2013-01-28 17:59:32
【问题描述】:

我无法发布我的 Web 服务,应该很简单:

  1. 我在 IIS 中创建应用程序,
  2. 将其放置为 4.0 Classic .Net
  3. 我从VS2012中的.Net解决方案发布它右键单击并发布 在 Webservice 项目上。

文件已放置,它应在指定服务器的 URL 上的浏览​​器上自行显示。

但我偶然发现了以下问题:

HTTP Error 404.17 - Not Found 
The requested content appears to be script and will not be served by the static file handler.

所以我一直在寻找它并找到了这两个选项:

选项 1:

http://www.banmanpro.com/support2/Requested_Content_Appears_to_be_Script.asp

这个说我应该去集成,而不是经典应用程序池。但这就像我将一个问题换成另一个问题,因为现在它说:

HTTP Error 500.21 - Internal Server Error
Handler "WebServiceHandlerFactory-Integrated" has a bad module "ManagedPipelineHandler" in its module list

当我转到网络配置时,看看这个错误是什么意思,我看不到 handler tag!

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <appSettings />
  <connectionStrings />
  <system.web>
    <compilation targetFramework="4.0" />
    <!--
      The <authentication> section enables configuration 
      of the security authentication mode used by 
      ASP.NET to identify an incoming user. 
    -->
    <authentication mode="Windows" />
    <!--
       The <customErrors> section enables configuration 
       of what to do if/when an unhandled error occurs 
       during the execution of a request. Specifically, 
       it enables developers to configure html error pages 
       to be displayed in place of a error stack trace.

       <customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
         <error statusCode="403" redirect="NoAccess.htm"/>
         <error statusCode="404" redirect="FileNotFound.htm"/>
       </customErrors>
    -->
    <pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID" />
  </system.web>
    <system.webServer>
        <directoryBrowse enabled="true" />
    </system.webServer>
  <!-- 
        The system.webServer section is required for running ASP.NET AJAX under Internet
        Information Services 7.0.  It is not necessary for previous version of IIS.
    -->
</configuration>

我应该添加一个吗?如果有,怎么做?

选项 2:

Script not served by static file handler on IIS7.5

基本上它说我应该做一个 aspnet_regiis -i,但是当我尝试时

转到 %windir%\Microsoft.NET\Framework\v4.0.30319

即使文件夹存在,没有aspnet_regiis!!

我只在 2.0 Fwk 上找到了 aspnet_regiis =(

这正常吗?

【问题讨论】:

  • 这是 WCF 服务还是 ASMX 服务?

标签: web-services c#-4.0 .net-4.0 iis-7.5 asmx


【解决方案1】:

处理程序标签不是答案,但是,这两个选项都促使我寻找 fwk 4 丢失的 aspnet_regiis。

没有 aspnet_regiis,因为首先实际上并未安装完整的 fwk 4.0

我在服务器上安装了 Framework 4 客户端配置文件 和调试器,这不是完整版本。从现在开始,每当我认为我安装了 fwk 4,我都会检查两次。

安装它之后,在 Framework 4.0 Classic 管道模式(而不是 Integrated)下让它工作得很好。

但是注意!

安装框架后,IIS 会将默认管道更改为 4.0,这意味着,如果您在 2.0 上运行的网站(站点/服务)将自动停止工作。 (发生在我身上)

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2011-03-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-09-05
    • 2011-07-27
    相关资源
    最近更新 更多