0

当我尝试访问任何 .asmx 以及我的自定义 http 处理程序时,我收到以下错误。我也已经将其移至 system.webserver .. 有什么想法吗?

HTTP Error 500.19 - Internal Server Error

The requested page cannot be accessed because the related configuration data for the page is invalid.
    <add name="UrlRoutingModule-4.0" type="System.Web.Routing.UrlRoutingModule" preCondition="managedHandler" />

网络配置:

<?xml version="1.0"?>
<!--
  For more information on how to configure your ASP.NET application, please visit
  http://go.microsoft.com/fwlink/?LinkId=169433
  -->
<configuration>
  <configSections>
    <section name="microsoft.web.services3" type="Microsoft.Web.Services3.Configuration.WebServicesConfiguration, Microsoft.Web.Services3, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
  </configSections>
  <connectionStrings>
  </connectionStrings>
  <system.web>
    <customErrors mode="Off"></customErrors>
    <compilation debug="true" targetFramework="4.0">
      <assemblies>
        <add assembly="System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
        <add assembly="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
        <add assembly="System.Speech, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
      </assemblies>
    </compilation>
    <httpRuntime maxRequestLength="2147483647"/>
    <webServices>
      <protocols>
        <add name="HttpGet"/>
        <add name="HttpPost"/>
      </protocols>
    </webServices>
  </system.web>
  <system.webServer>
    <modules runAllManagedModulesForAllRequests="true"/>
    <handlers>
      <add name="SpartHandler" verb="*" path="*.sparta" type="SpartaMessage_WebServices.IHTTPTransfer, SpartaMessage_WebServices" resourceType="Unspecified"/>
    </handlers>
  </system.webServer>
  <system.net>
  </system.net>
</configuration>
4

1 回答 1

0

不要将处理程序放在 system.webServer 中,而是将 httpHandlers 放在 system.web 中:

  <system.web>
    ...
    <httpHandlers>
      <add name="SpartHandler" verb="*" path="*.sparta" type="SpartaMessage_WebServices.IHTTPTransfer, SpartaMessage_WebServices" resourceType="Unspecified" />
    </httpHandlers>
  </system.web>
于 2012-05-29T09:08:14.137 回答