0

我无法发布我的 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

当我转到网络配置时,看看这个错误是什么意思,我看不到处理程序标签!

<?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:

IIS7.5 上的静态文件处理程序不提供脚本

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

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

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

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

这正常吗?

4

1 回答 1

1

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

没有 aspnet_regiis 因为完整的 fwk 4.0 实际上并没有安装在第一位。

我在服务器上安装了Framework 4 Client Profile和调试器,它不是完整版本。从现在开始,每当我认为我安装了 fwk 4 时,我都会检查两次。

安装后,在 Framework 4.0 Classic Pipeline Mode(而不是Integrated)上让它工作得很好。

但是注意!

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

于 2013-01-29T16:12:28.240 回答