如何在 IIS 7.0 中托管 MVC 应用程序?
我创建了一个 MVC 应用程序,它在本地主机上运行良好。我使用 Visual Studio 将项目发布到本地文件夹并将其上传到 FTP 位置。但在服务器上它不起作用。
我遵循了几个教程但没有结果 http://haacked.com/archive/2008/11/03 /bin-deploy-aspnetmvc.aspx http://www.hanselman.com/blog/IntegratingASPNETMVC3IntoExistingUpgradedASPNET4WebFormsApplications.aspx
有一些好的教程或者有人可以帮忙吗? 谢谢
I created a MVC application which is working fine in the local host. I published the project using visual studio to a local folder and uploaded it to the FTP location. But on server its not working.
I followed a couple of tutorials but no result
http://haacked.com/archive/2008/11/03/bin-deploy-aspnetmvc.aspx
http://www.hanselman.com/blog/IntegratingASPNETMVC3IntoExistingUpgradedASPNET4WebFormsApplications.aspx
Is there some good tutorials or could someone help please?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以检查以下几项内容:
集成管道
而不是经典
。web.config
文件是否包含
元素。如果您使用集成管道,这是注册 HttpModules 的地方。
元素的属性runAllManagedModulesForAllRequests
设置为“true”
。这会导致HttpModules
为所有请求工作,从而允许UrlRouteModule
完成它的工作。您还必须删除并添加 HttpModule。基本上,
web.config
中的
部分应包含如下内容:(请注意,在本例中,MVC 平台的版本 1.0 是您不应该复制并粘贴此片段,这纯粹是为了表明它应该是什么样子)
There are a couple of things that you could check:
integrated pipeline
instead ofclassic
.web.config
file contains<system.webServer>
element. This is the place where theHttpModules
are registered if you are using the integrated pipeline.<modules>
element has the attributerunAllManagedModulesForAllRequests
set to"true"
. This causes theHttpModules
to work for all requests, allowing theUrlRouteModule
to do it's work. You also have to remove and add the HttpModules.Basically, the
<system.webServer>
section inweb.config
should contain something like this:(note that in this case version 1.0 of the MVC platform is used. you should not copy & paste this fragment. It's purely an indication of what it should look like)
我们在运行时遇到了问题。通常(但并非总是),通过 Web 平台安装程序在服务器上安装 ASP.NET MVC 似乎可以解决任何问题。 YMMV。
We've had problems getting running. Usually (but not always), installing ASP.NET MVC on the server via the Web Platform Installer seems to fix whatever the problem is. YMMV.