2012-05-20 106 views
0

當我嘗試訪問任何.asmx以及我的自定義http處理程序時,出現以下錯誤。我已經移動到system.webserver太..任何想法?HTTPHandler在IIS 7.5上失敗,使用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" /> 

的Web.Config:

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

回答

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> 
相關問題