如何运行asp.net mvc3应用程序
这可以在 xp 上运行/部署 asp.net mvc3 吗?
通过 vs2010 发布,然后在 IE/Firefox 中浏览会出现此错误消息
目录列表被拒绝
此虚拟目录不允许列出内容。
启用目录浏览没有帮助,因为没有 default.aspx 可以运行?
抱歉,我的网络开发技能有点“生疏”!
Is this possible to run/deploy asp.net mvc3 on xp ?
publishing it via vs2010 and then browsing in IE/Firefox gives this error message
Directory Listing Denied
This Virtual Directory does not allow contents to be listed.
Enabling directory browsing does not help as there is no default.aspx to run ?
Sorry my web dev skills are a "bit" rusty !
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
问题是 ASP .NET MVC 基于 URL 路由,为了使其正常工作,请求需要由 ASP .NET 解析,问题是如果没有 .aspx 扩展名,它将无法被解析(IIS 6 问题 iirc) 。
因此,您必须更改 MVC 的 URL 路由和/或将扩展映射到 ASP.NET 请求处理程序
查看此链接以了解详细信息:
http:// /haacked.com/archive/2010/12/22/asp-net-mvc-3-extensionless-urls-on-iis-6.aspx
The problem is that ASP .NET MVC is based on URL routing and for that to work, the request needs to be parsed by ASP .NET, problem is that without the .aspx extension it won´t get parsed (IIS 6 problem iirc).
So you have to change the URL routing of MVC and/or map an extension to the ASP.NET request handler
Check out this link for the details:
http://haacked.com/archive/2010/12/22/asp-net-mvc-3-extensionless-urls-on-iis-6.aspx
你的问题并没有提供很多信息。如果我是你,我就会开始。
Your questions does not give a lot of information. If i were you, i would start by.
我怀疑您没有在 IIS 中正确配置应用程序。
请使用以下步骤进行配置。
MVC3 发布和 IIS 6
I suspect you are not configuring the application properly in IIS.
Please use these steps to configure it.
MVC3 publishing and IIS 6
我有一个 MVC3 应用程序在运行 IIS 6 的 Windows Server 2003 计算机上运行良好。唯一需要的是在计算机上安装 .net 4.0 框架,然后从 MVC 项目告诉项目对所需的文件进行 bin 部署运行 ASP.net MVC。发布后,这些 .dll 应该最终出现在应用程序的 bin 文件夹中:
之后您就可以开始了。
MVC3 应用程序现在更容易部署的快速而肮脏的原因是 Microsoft 已经调整了 4.0 框架以轻松设置 MVC 所依赖的路由。您可以从Web 平台安装程序获取最新版本的.net 4.0 框架。
祝你好运,希望这对一些人有帮助。
I've got an MVC3 application running fine on a Windows Server 2003 machine running IIS 6. The only need was to install the .net 4.0 framework on the machine and then from the MVC project tell the project to bin-deploy the files needed to run ASP.net MVC. These .dll's should end up in the application's bin folder after a publish:
After that you should be ready to go.
The quick and dirty reason an MVC3 application is easier to deploy now is that Microsoft has tweaked the 4.0 framework to easily setup routing which MVC depends on. You can get the latest version of the .net 4.0 framework from Web Platform Installer.
Good luck and hope this helps some.