我已经将ASP.NET应用程序转换为一起运行ASP.NET和MVC 3。并且有一些Web服务(/WS/Inventory.asmx/getInventory)现在显示以下异常:
System.Web.HttpException: Failed to Execute URL.
[HttpException (0x80004005): Failed to Execute URL.]
System.Web.Hosting.ISAPIWorkerRequestInProcForIIS6.BeginExecuteUrl(String url, String method, String childHeaders, Boolean sendHeaders, Boolean addUserIndo, IntPtr token, String name, String authType, Byte[] entity, AsyncCallback cb, Object state) +2428801
System.Web.HttpResponse.BeginExecuteUrlForEntireResponse(String pathOverride, NameValueCollection requestHeaders, AsyncCallback cb, Object state) +417
System.Web.DefaultHttpHandler.BeginProcessRequest(HttpContext context, AsyncCallback callback, Object state) +192
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +8862676
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +184
我在Windows 7上使用IIS 7运行它,尽管在Windows 2003上存在相同的异常。
这是网络配置部分:
<system.webServer>
<defaultDocument>
<files>
<add value="index.aspx" />
</files>
</defaultDocument>
<httpErrors errorMode="Detailed" />
<modules runAllManagedModulesForAllRequests="true">
<add name="OverloadProtection" type="Winncom.Classes.HttpModules.OverloadProtection,Winncom" preCondition="managedHandler" />
<add name="Rewrite" type="Winncom.Classes.HttpModules.Rewrite,Winncom" preCondition="managedHandler" />
<add name="HttpCompression" type="Winncom.Classes.HttpModules.HttpCompression,Winncom" preCondition="managedHandler" />
</modules>
<handlers>
<remove name="UrlRoutingHandler" />
<add name="PageHandlerFactory-ISAPI-2.0-html" path="*.html" verb="*" modules="IsapiModule" scriptProcessor="C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" resourceType="Unspecified" requireAccess="None" preCondition="classicMode,runtimeVersionv4.0,bitness32" />
<add name="*.aspx_*" path="*.aspx" verb="*" type="Winncom.Classes.Service.HandlerDispatcher" resourceType="Unspecified" requireAccess="Script" preCondition="integratedMode,runtimeVersionv4.0" />
<add name="*/cjpegimage.aspx_*" path="*/cjpegimage.aspx" verb="*" type="System.Web.UI.PageHandlerFactory" preCondition="integratedMode,runtimeVersionv2.0" />
<add name="*/webpages/*.html_*" path="*/webpages/*.html" verb="*" type="System.Web.UI.PageHandlerFactory" preCondition="integratedMode,runtimeVersionv2.0" />
</handlers>
<validation validateIntegratedModeConfiguration="false" />
</system.webServer>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
任何想法都会很好。谢谢!
答案 0 :(得分:0)
尝试将此添加到web.config
中的处理程序部分<add verb="*" path="*.asmx" type="System.Web.Services.Protocols.WebServiceHandlerFactory, System.Web.Services, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" validate="false"/>