ASP。NET MVC3在IIS 7.5中

时间:2021-04-29 03:32:42

Hi I want to publish an MVC 3 site in Windows Server 2008 R2 SP1. I installed MVC 3 and MVC 2. When I created an MVC 2 site, it worked fine but the MVC 3 site did not work. I installed MVC 3 first and when the site did not work, I installed MVC 2 and tested the other (MVC 2) site and every thing was ok. The problems is MVC 3.

你好,我想在Windows Server 2008 R2 SP1中发布一个MVC 3站点。我安装了MVC 3和MVC 2。当我创建一个MVC 2站点时,它工作得很好,但是MVC 3站点不工作。我首先安装了MVC 3,当站点不工作时,我安装了MVC 2并测试了另一个(MVC 2)站点,一切正常。问题是MVC 3。

ANY HELP PLEASE Here is the error:

有什么帮助吗?这里有个错误:

Error Summary HTTP Error 403.14 - Forbidden The Web server is configured to not list the contents of this directory. Detailed Error Information Module DirectoryListingModule Notification ExecuteRequestHandler Handler StaticFile Error Code 0x00000000 Requested URL https://mywebsite.test.own:443/ Physical Path D:\WebSite Logon Method Anonymous Logon User Anonymous Most likely causes:

错误摘要HTTP错误403.14 -禁止将Web服务器配置为不列出此目录的内容。详细的错误信息模块DirectoryListingModule通知ExecuteRequestHandler处理程序StaticFile错误代码0x00000000请求的URL https://mywebsite.test。自有:443/物理路径D:\网站登录方法匿名登录用户最可能的原因:

A default document is not configured for the requested URL, and directory browsing is not enabled on the server.

Things you can try:

你可以尝试:

If you do not want to enable directory browsing, ensure that a default document is configured and that the file exists.
Enable directory browsing using IIS Manager.
    Open IIS Manager.
    In the Features view, double-click Directory Browsing.
    On the Directory Browsing page, in the Actions pane, click Enable.
Verify that the configuration/system.webServer/directoryBrowse@enabled attribute is set to true in the site or application configuration file.

Links and More Information This error occurs when a document is not specified in the URL, no default document is specified for the Web site or application, and directory listing is not enabled for the Web site or application. This setting may be disabled on purpose to secure the contents of the server.

当URL中没有指定文档、没有为Web站点或应用程序指定默认文档、Web站点或应用程序未启用目录列表时,就会出现此错误。为了保护服务器的内容,可以禁用此设置。

View more information »

查看更多信息”

9 个解决方案

#1


13  

It looks like the request is going to the static file handler and is not getting into the MVC stack at all. Some things to check...

看起来这个请求是指向静态文件处理程序的,并且根本没有进入MVC堆栈。有些事情要检查…

In the config file do you have runAllManagedModulesForAllRequests set to true on the element?

在配置文件中,是否在元素上将runAllManagedModulesForAllRequests设置为true ?

Are you running in an application pool configured for .NET 4 and Integrated Pipeline mode?

您是否正在为.NET 4和集成管道模式配置的应用程序池中运行?

That's all I can think of right now, but if I have other thoughts I'll update the post.

这就是我现在所能想到的,但如果我有其他想法,我会更新这篇文章。

#2


13  

For ASP.NET MVC 3.0 on IIS 7.5 Windows Server 2008, I found that I had to run aspnet_regiis -i from the C:\Windows\Microsoft.NET\Framework\<version> folder. This resolved the problem.

ASP。净MVC 3.0 IIS 7.5 Windows Server 2008,我发现我不得不从C:\Windows\Microsoft.运行aspnet_regiis -我净\ Framework \ <版本> 文件夹中。这解决了问题。

#3


6  

just in case these solutions did not work for someone, I ran into the same issue and finally tracked it down to a folder under my root directory named the same as an area.

如果这些解决方案对某人不起作用,我就会遇到同样的问题,并最终将其跟踪到根目录下的一个文件夹,该文件夹命名为一个区域。

For example, I had an area named "Users" and also a folder under my root directory named the same. So "domain.com/users" was actually pointing to a folder under my root drive instead of an area.

例如,我有一个名为“Users”的区域,以及一个名为same的根目录下的文件夹。查查domain.com/users"实际上是指向我根驱动器下的一个文件夹而不是一个区域。

Hope this helps someone!

希望这可以帮助别人!

#4


1  

The short answer is that you need to "Bin Deploy" the ASP.NET MVC 3 app.

简而言之,您需要“Bin Deploy”ASP。净MVC 3应用程序。

Please read Bin Deploying ASP.NET MVC 3 with Razor to a Windows Server without MVC. Please also read Bin deploy for MVC 3 with Visual Studio 2010 SP1.

请阅读Bin deploy ASP。NET MVC 3与Razor到一个没有MVC的Windows服务器。还请您阅读使用Visual Studio 2010 SP1的MVC 3的Bin部署。

I was able to (partially) solve this problem by installing Visual Studio 2010 SP1 and then utilizing the Add Dependency Assemblies command.

通过安装Visual Studio 2010 SP1并使用Add Dependency assembly命令,我(部分)解决了这个问题。

The reason I said that I was able to partially solve this problem is because this solution worked for my local IIS 7.5 on Windows 7 but has not worked for IIS 7 on a Windows Server 2008 R2. I am not sure if the problem is continuing or whether it is not a permissions issue. I have not had the chance to look at it in depth yet. Failed Request Tracing seems to suggest that it is the same issue as before, i.e., 403.14. I will update my answer when I know more.

我之所以能够部分地解决这个问题,是因为这个解决方案适用于Windows 7上的本地IIS 7.5,但不适用于Windows Server 2008 R2上的IIS 7。我不确定这个问题是否还在继续,或者它是不是一个权限问题。我还没有机会深入研究它。失败的请求跟踪似乎表明它与以前是相同的问题,即。403.14点。当我知道更多的时候我会更新我的答案。

#5


1  

  1. Right click on the your root project node in VS 2010 and select "Add Deployable Dependencies" and then choose:
  2. 在VS 2010中右键单击您的根项目节点,选择“添加可部署依赖项”,然后选择:

a) ASP .NET MVC

ASP。net MVC

b) ASP .NET Web Pages with Razor syntax

b)使用Razor语法的。net网页

(Press OK and Publish the project)

(按OK,发布项目)

  1. The element "runAllManagedModulesForAllRequests" of the web.config should be = "true". (By Default it is TRUE)

    元素“runallmanagedmodulesforallrequest”web。配置应该是= "true"。(默认情况下是真的)

  2. Under IIS 7.5 "Basic Settings" check if the website has Application pool like "ASP.NET v4.0"

    在IIS 7.5“基本设置”下,检查网站是否有“ASP”这样的应用程序池。净v4.0”

  3. Make sure if you downloads ALL files from the BIN folder. Sometimes FileZilla gets stuck... So, check it twice.

    确保从BIN文件夹下载所有文件。有时FileZilla卡住……所以,检查两次。

I hope this will help! :)

我希望这能有所帮助!:)

#6


1  

I had the same problem on Server 2008 x64 version. ASP.NET MVC3 site does not work. I check everything in IIS. The problem was solved only after turning on HTTP Redirection service in IIS role.

服务器2008 x64版本也有同样的问题。ASP。NET MVC3网站不工作。我检查IIS中的所有东西。这个问题只有在IIS角色中打开HTTP重定向服务后才能解决。

For Windows 7 check this location: Windows Features -> Internet Information Services -> World Wide Web Services -> Common HTTP features -> HTTP Redirection.

对于Windows 7,请检查这个位置:Windows特性—> Internet信息服务—> World Wide Web Services—>常见的HTTP特性—> HTTP重定向。

#7


0  

My actual problem was that I had mucked around with the _ViewStart.cshtml and _Layout.cshtml files. Specifically, I had changed the name of the _Layout.cshtml file to _PageLayout.cshtml and amended the references to it in _ViewStart.cshtml.

我的实际问题是我在_ViewStart上犯了错误。cshtml _Layout。cshtml文件。具体地说,我已经更改了_Layout的名称。_PageLayout cshtml文件。修改_ViewStart.cshtml中的对它的引用。

That worked on VS2010 and on my home machine running Windows 7 32-bit, but it did not work on either my work machine running Windows 7 64-bit or my development server running Windows Server 2008 R2.

这在VS2010和我的运行Windows 7 32位的家庭机器上都能运行,但在运行Windows 7 64位的工作机器和运行Windows server 2008 R2的开发服务器上都不能工作。

The solution for me was to now try to change the name of _Layout.cshtml file.

我的解决方案是现在尝试更改_Layout的名称。cshtml文件。

#8


0  

http://www.asp.net/mvc/tutorials/older-versions/deployment/using-asp-net-mvc-with-different-versions-of-iis-cs

http://www.asp.net/mvc/tutorials/older-versions/deployment/using-asp-net-mvc-with-different-versions-of-iis-cs

#9


0  

I was receiving this error when I deployed the Microsoft tutorial application ContsosoUniversity exactly according to the tutorial guidelines (http://www.asp.net/mvc/tutorials/deployment). After trying all the recommendations of multiple posts I resolved this problem by deleting all other applications in the root directory (from within IIS Manager) and re-deploying the application. One of the other applications in the DefaultAppPool (within which it runs) must have been interfering.

当我按照教程指南(http://www.asp.net/mvc/tutorials/deployment)部署微软教程应用程序ContsosoUniversity时,我收到了这个错误。在尝试了多个帖子的建议之后,我通过删除根目录中的所有其他应用程序(从IIS管理器中)来解决这个问题,并重新部署应用程序。DefaultAppPool(在其中运行)中的另一个应用程序肯定一直在进行干扰。

#1


13  

It looks like the request is going to the static file handler and is not getting into the MVC stack at all. Some things to check...

看起来这个请求是指向静态文件处理程序的,并且根本没有进入MVC堆栈。有些事情要检查…

In the config file do you have runAllManagedModulesForAllRequests set to true on the element?

在配置文件中,是否在元素上将runAllManagedModulesForAllRequests设置为true ?

Are you running in an application pool configured for .NET 4 and Integrated Pipeline mode?

您是否正在为.NET 4和集成管道模式配置的应用程序池中运行?

That's all I can think of right now, but if I have other thoughts I'll update the post.

这就是我现在所能想到的,但如果我有其他想法,我会更新这篇文章。

#2


13  

For ASP.NET MVC 3.0 on IIS 7.5 Windows Server 2008, I found that I had to run aspnet_regiis -i from the C:\Windows\Microsoft.NET\Framework\<version> folder. This resolved the problem.

ASP。净MVC 3.0 IIS 7.5 Windows Server 2008,我发现我不得不从C:\Windows\Microsoft.运行aspnet_regiis -我净\ Framework \ <版本> 文件夹中。这解决了问题。

#3


6  

just in case these solutions did not work for someone, I ran into the same issue and finally tracked it down to a folder under my root directory named the same as an area.

如果这些解决方案对某人不起作用,我就会遇到同样的问题,并最终将其跟踪到根目录下的一个文件夹,该文件夹命名为一个区域。

For example, I had an area named "Users" and also a folder under my root directory named the same. So "domain.com/users" was actually pointing to a folder under my root drive instead of an area.

例如,我有一个名为“Users”的区域,以及一个名为same的根目录下的文件夹。查查domain.com/users"实际上是指向我根驱动器下的一个文件夹而不是一个区域。

Hope this helps someone!

希望这可以帮助别人!

#4


1  

The short answer is that you need to "Bin Deploy" the ASP.NET MVC 3 app.

简而言之,您需要“Bin Deploy”ASP。净MVC 3应用程序。

Please read Bin Deploying ASP.NET MVC 3 with Razor to a Windows Server without MVC. Please also read Bin deploy for MVC 3 with Visual Studio 2010 SP1.

请阅读Bin deploy ASP。NET MVC 3与Razor到一个没有MVC的Windows服务器。还请您阅读使用Visual Studio 2010 SP1的MVC 3的Bin部署。

I was able to (partially) solve this problem by installing Visual Studio 2010 SP1 and then utilizing the Add Dependency Assemblies command.

通过安装Visual Studio 2010 SP1并使用Add Dependency assembly命令,我(部分)解决了这个问题。

The reason I said that I was able to partially solve this problem is because this solution worked for my local IIS 7.5 on Windows 7 but has not worked for IIS 7 on a Windows Server 2008 R2. I am not sure if the problem is continuing or whether it is not a permissions issue. I have not had the chance to look at it in depth yet. Failed Request Tracing seems to suggest that it is the same issue as before, i.e., 403.14. I will update my answer when I know more.

我之所以能够部分地解决这个问题,是因为这个解决方案适用于Windows 7上的本地IIS 7.5,但不适用于Windows Server 2008 R2上的IIS 7。我不确定这个问题是否还在继续,或者它是不是一个权限问题。我还没有机会深入研究它。失败的请求跟踪似乎表明它与以前是相同的问题,即。403.14点。当我知道更多的时候我会更新我的答案。

#5


1  

  1. Right click on the your root project node in VS 2010 and select "Add Deployable Dependencies" and then choose:
  2. 在VS 2010中右键单击您的根项目节点,选择“添加可部署依赖项”,然后选择:

a) ASP .NET MVC

ASP。net MVC

b) ASP .NET Web Pages with Razor syntax

b)使用Razor语法的。net网页

(Press OK and Publish the project)

(按OK,发布项目)

  1. The element "runAllManagedModulesForAllRequests" of the web.config should be = "true". (By Default it is TRUE)

    元素“runallmanagedmodulesforallrequest”web。配置应该是= "true"。(默认情况下是真的)

  2. Under IIS 7.5 "Basic Settings" check if the website has Application pool like "ASP.NET v4.0"

    在IIS 7.5“基本设置”下,检查网站是否有“ASP”这样的应用程序池。净v4.0”

  3. Make sure if you downloads ALL files from the BIN folder. Sometimes FileZilla gets stuck... So, check it twice.

    确保从BIN文件夹下载所有文件。有时FileZilla卡住……所以,检查两次。

I hope this will help! :)

我希望这能有所帮助!:)

#6


1  

I had the same problem on Server 2008 x64 version. ASP.NET MVC3 site does not work. I check everything in IIS. The problem was solved only after turning on HTTP Redirection service in IIS role.

服务器2008 x64版本也有同样的问题。ASP。NET MVC3网站不工作。我检查IIS中的所有东西。这个问题只有在IIS角色中打开HTTP重定向服务后才能解决。

For Windows 7 check this location: Windows Features -> Internet Information Services -> World Wide Web Services -> Common HTTP features -> HTTP Redirection.

对于Windows 7,请检查这个位置:Windows特性—> Internet信息服务—> World Wide Web Services—>常见的HTTP特性—> HTTP重定向。

#7


0  

My actual problem was that I had mucked around with the _ViewStart.cshtml and _Layout.cshtml files. Specifically, I had changed the name of the _Layout.cshtml file to _PageLayout.cshtml and amended the references to it in _ViewStart.cshtml.

我的实际问题是我在_ViewStart上犯了错误。cshtml _Layout。cshtml文件。具体地说,我已经更改了_Layout的名称。_PageLayout cshtml文件。修改_ViewStart.cshtml中的对它的引用。

That worked on VS2010 and on my home machine running Windows 7 32-bit, but it did not work on either my work machine running Windows 7 64-bit or my development server running Windows Server 2008 R2.

这在VS2010和我的运行Windows 7 32位的家庭机器上都能运行,但在运行Windows 7 64位的工作机器和运行Windows server 2008 R2的开发服务器上都不能工作。

The solution for me was to now try to change the name of _Layout.cshtml file.

我的解决方案是现在尝试更改_Layout的名称。cshtml文件。

#8


0  

http://www.asp.net/mvc/tutorials/older-versions/deployment/using-asp-net-mvc-with-different-versions-of-iis-cs

http://www.asp.net/mvc/tutorials/older-versions/deployment/using-asp-net-mvc-with-different-versions-of-iis-cs

#9


0  

I was receiving this error when I deployed the Microsoft tutorial application ContsosoUniversity exactly according to the tutorial guidelines (http://www.asp.net/mvc/tutorials/deployment). After trying all the recommendations of multiple posts I resolved this problem by deleting all other applications in the root directory (from within IIS Manager) and re-deploying the application. One of the other applications in the DefaultAppPool (within which it runs) must have been interfering.

当我按照教程指南(http://www.asp.net/mvc/tutorials/deployment)部署微软教程应用程序ContsosoUniversity时,我收到了这个错误。在尝试了多个帖子的建议之后,我通过删除根目录中的所有其他应用程序(从IIS管理器中)来解决这个问题,并重新部署应用程序。DefaultAppPool(在其中运行)中的另一个应用程序肯定一直在进行干扰。