Asp.net mvc MVC.NET路由在开发服务器上工作,但在IIS 7.0上不工作
我已经将我们的项目从一个网站升级到一个web应用程序,并导入到VS2k10 我添加了以下参考资料: System.Web.Abstractions System.Web.MVC System.Web.Routing 将目标框架更改为4.0 添加了控制器“HomeController.cs”。。。这现在可以在开发服务器中使用,但不能在IIS 7.0中使用 Windows服务器2k8 r2 VS2010 .net framework 4.0 应用程序池正在以集成管道模式运行。。。我有点困惑,为什么它可以在dev服务器上工作,而不能在IIS上工作Asp.net mvc MVC.NET路由在开发服务器上工作,但在IIS 7.0上不工作,asp.net-mvc,iis-7.5,windows-server-2008-r2,Asp.net Mvc,Iis 7.5,Windows Server 2008 R2,我已经将我们的项目从一个网站升级到一个web应用程序,并导入到VS2k10 我添加了以下参考资料: System.Web.Abstractions System.Web.MVC System.Web.Routing 将目标框架更改为4.0 添加了控制器“HomeController.cs”。。。这现在可以在开发服务器中使用,但不能在IIS 7.0中使用 Windows服务器2k8 r2 VS2010 .net framework 4.0 应用程序池正在以集成管道模式运行。。。我有点困惑,为什么
<system.webServer>
<modules>
<add name="ErrorHandlerModule" type="System.Web.Mobile.ErrorHandlerModule, System.Web.Mobile, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" preCondition="managedHandler" />
<add name="ServiceModel" type="System.ServiceModel.Activation.HttpModule, System.ServiceModel.Activation, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" preCondition="managedHandler" />
<add name="Page" type="Impark.MPS.SelfServe.UIL.GlobalPageEvents, PageEventsModule" preCondition="managedHandler" />
</modules>
<handlers>
<add name="*.vbhtml_*" path="*.vbhtml" verb="*" type="System.Web.HttpForbiddenHandler" preCondition="integratedMode,runtimeVersionv2.0" />
<add name="*.vbhtm_*" path="*.vbhtm" verb="*" type="System.Web.HttpForbiddenHandler" preCondition="integratedMode,runtimeVersionv2.0" />
<add name="*.cshtml_*" path="*.cshtml" verb="*" type="System.Web.HttpForbiddenHandler" preCondition="integratedMode,runtimeVersionv2.0" />
<add name="*.cshtm_*" path="*.cshtm" verb="*" type="System.Web.HttpForbiddenHandler" preCondition="integratedMode,runtimeVersionv2.0" />
<add name="*.aspq_*" path="*.aspq" verb="*" type="System.Web.HttpForbiddenHandler" preCondition="integratedMode,runtimeVersionv2.0" />
<add name="*.xamlx_*" path="*.xamlx" verb="*" type="System.Xaml.Hosting.XamlHttpHandlerFactory, System.Xaml.Hosting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" preCondition="integratedMode,runtimeVersionv2.0" />
<add name="*.xoml_*" path="*.xoml" verb="*" type="System.ServiceModel.Activation.HttpHandler, System.ServiceModel.Activation, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" preCondition="integratedMode,runtimeVersionv2.0" />
<add name="*.rules_*" path="*.rules" verb="*" type="System.Web.HttpForbiddenHandler" preCondition="integratedMode,runtimeVersionv2.0" />
<add name="*.svc_*" path="*.svc" verb="*" type="System.ServiceModel.Activation.HttpHandler, System.ServiceModel.Activation, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" preCondition="integratedMode,runtimeVersionv2.0" />
<add name="*.soap_*" path="*.soap" verb="*" type="System.Runtime.Remoting.Channels.Http.HttpRemotingHandlerFactory, System.Runtime.Remoting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" preCondition="integratedMode,runtimeVersionv2.0" />
<add name="*.rem_*" path="*.rem" verb="*" type="System.Runtime.Remoting.Channels.Http.HttpRemotingHandlerFactory, System.Runtime.Remoting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" preCondition="integratedMode,runtimeVersionv2.0" />
<add name="*.asmx_*" path="*.asmx" verb="*" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" preCondition="integratedMode,runtimeVersionv2.0" />
<add name="ScriptResource.axd_GET,HEAD" path="ScriptResource.axd" verb="GET,HEAD" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" preCondition="integratedMode,runtimeVersionv2.0" />
<add name="*_AppService.axd_*" path="*_AppService.axd" verb="*" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" preCondition="integratedMode,runtimeVersionv2.0" />
<add name="eurl.axd_*" path="eurl.axd" verb="*" type="System.Web.HttpNotFoundHandler" preCondition="integratedMode,runtimeVersionv2.0" />
</handlers>
<validation validateIntegratedModeConfiguration="false" />
</system.webServer>
对不起,忘了提了。在dev服务器上,我得到了预期的响应。我在IIS中获得的相同URL:
错误摘要
HTTP错误404.0-找不到
您正在查找的资源已被删除,名称已更改,或暂时不可用。如果使用.Net 4.0,则应将runtimeVersionv2.0从前置条件中删除如果使用.Net 4.0,则应将runtimeVersionv2.0从前置条件中删除是否确保已将所有必需的文件移动到故障机器上。错误说明找不到文件?相同的物理计算机和路径。。。没有文件移动。。。但我只是找到了一个线索。。。当我在dev server中添加虚拟服务器路径时,它现在也失败了。。。IE工作。。。但是你没有确定你已经把所有必要的文件移到了故障机器上吗。错误说明找不到文件?相同的物理计算机和路径。。。没有文件移动。。。但我只是找到了一个线索。。。当我在dev server中添加虚拟服务器路径时,它现在也失败了。。。IE工作。。。但事实并非如此