我的系统是windows7,在IIS7上部署MVC3程序,问题如下:
[HttpException (0x80004005): 未能执行 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) +2446929
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() +8967348
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +184
我的配置文件如下:
1 <system.webServer>
2 <validation validateIntegratedModeConfiguration="false" />
3 <handlers>
4 <add name="MVC" path="*" verb="*" modules="IsapiModule" scriptProcessor="C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" resourceType="Unspecified" preCondition="classicMode,runtimeVersionv4.0,bitness32" />
5 </handlers>
6 </system.webServer>
handlers是后来加上的,不加的话mvc程序无法运行,加上了程序OK,但是无法访问所有静态资源。
我找到了问题的解决方法,不知道你们的问题出在哪里,我的解决方法是
在<system.web>中加入:
1 <httpHandlers>
2 <add verb="*" path="*" type="System.Web.StaticFileHandler" />
3 </httpHandlers>
静态文件及样式文件都能加载了