本文介绍了MVC3发布和IIS 6的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在争取这个几个小时没有进展。

I've been fighting with this for several hours with no headway.

我想发布一个Web应用程序(MVC3,.NET4,在Visual Studio 2010年取得),以一台服务器。所有的谷歌最终导致的,这并没有帮助的。据此,在IIS 6上运行MVC3(安装有MVC和.NET4,它是一个2K3服务器)应该只是工作。不同的设置窗口给我不同的问题,但没有什么工作。在默认设置下,我得到拒绝目录列表此虚拟目录不允许的内容将上市。如果我打开目录浏览功能,我可以看到该网站的directoy,但是这是没有用的。

I am trying to publish a web app (MVC3, .net4, made in Visual Studio 2010) to a server. All googles eventually lead to this article, which has not been helpful. According to it, MVC3 running on IIS 6 (MVC and .net4 are installed, it is a 2k3 server) should just work. Different set ups give me different issues, but nothing that works. With default settings, I get "Directory Listing Denied This Virtual Directory does not allow contents to be listed." If I turn on directory browsing I can see the directoy of the site, but this isn't useful.

在IIS中有一个选项可以使用默认的页面,但我认为MVC没有用的。当我开始了,并且一直工作正常,通过调试测试本地服务器有我的项目中没有的Default.aspx。如果我需要一个默认的页面,我不知道该如何制作。如果我不需要的,做什么设置,我需要在IIS 6中使用让它服务于网页正常(使用MVC模块?)。

In IIS there is an option to use the default page, but I thought that MVC didn't use one. There was no "default.aspx" in my project when I started it, and it has been working fine through the debug testing local server. If I need a default page, I don't know how to make one. If I don't need one, what settings do I need to use in IIS 6 to get it to serve the pages properly (using the mvc module?).

这是我的第一个Web应用程序,所以我可能失去了一些东西基本。这是完全有可能我删除了一些重要的文件从项目。

This is my first web app, so I am probably missing something basic. It's entirely possible I deleted some critical file from the project.

编辑:不知道,如果它的确与众不同,但该网站没有被发布到域的根。该网址最终被www.company.net/directory。

not sure if it makes a difference, but the site is not being published to the root of the domain. The URL ends up being www.company.net/directory.

编辑:我试图使在Visual Studio中,只是默认一个新的MVC3应用程序,并立即发布到服务器。同样的错误。它肯定的东西在IIS中。

I tried making a new MVC3 app in visual studio, just the default one, and published it immediately to the server. Same error. Its definitely something in IIS.

推荐答案

试试这个。

  1. 打开IIS管理器。
  2. 项目
  3. 选择您的网站,那么属性。
  4. 转到虚拟目录
  5. 点击上配置
  6. 在应用程序配置
    应用扩展 - 添加.mvc扩展名和路径C:\ WINDOWS \ microsoft.net \框架\ v4.xxxxx \ aspnet_isapi.dll的
  7. 在通配符应用程序映射插入相同的路径与上述
  8. 取消选中验证文件是否存在(如果你选择了它不会运行)
  1. Open IIS manager.
  2. List item
  3. Select your website then properties.
  4. Go to Virtual directory
  5. Click on Configuration
  6. On Application Configuration
    Application extension - add .mvc extension and pathC:\windows\microsoft.net\framework\v4.xxxxx\aspnet_isapi.dll
  7. On the wildcard application maps insert same path as above
  8. UNCHECK verify that file exists (if you check it won't run)

菲尔哈克有一个很好的文章:http://haacked.com/archive/2008/11/26/asp.net-mvc-on-iis-6-walkthrough.aspx

Phil Haack has a good article: http://haacked.com/archive/2008/11/26/asp.net-mvc-on-iis-6-walkthrough.aspx

这篇关于MVC3发布和IIS 6的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-06 07:59