ASP.NET MVC3 In IIS 7.5

29,863

Solution 1

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.

Solution 2

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...

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

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

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

Solution 3

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.

Hope this helps someone!

Solution 4

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

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.

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

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.

Solution 5

  1. Right click on the your root project node in VS 2010 and select "Add Deployable Dependencies" and then choose:

a) ASP .NET MVC

b) ASP .NET Web Pages with Razor syntax

(Press OK and Publish the project)

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

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

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

I hope this will help! :)

Share:
29,863

Related videos on Youtube

aladdin
Author by

aladdin

Updated on September 17, 2020

Comments

  • aladdin
    aladdin over 3 years

    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.

    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:

    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.

    View more information »

  • Umar Farooq Khawaja
    Umar Farooq Khawaja almost 13 years
    My real issue seemed to be that I had renamed the _Layout.cshtml file to _PageLayout.cshtml and while I had modified the reference to it in _ViewStart.cshtml as well, still ASP.NET MVC 3 didn't seem to pick it up correctly on Windows 7 64 bit or Windows Server 2008 R2 32 bit.
  • Adaptabi
    Adaptabi over 12 years
    Also, please comment any modules and handlers from system.webserver which might be related to .NET 3.5 / MVC 2.0 or IIS 6 - so they are obsolete now, but will make your life a pain!
  • Bill the Lizard
    Bill the Lizard over 12 years
    Welcome to Stack Overflow! Welcome to Stack Overflow! While this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference.
  • emily-bcot
    emily-bcot about 12 years
    we have a huge site with all kinds of folders and this was the problem in my case
  • krillgar
    krillgar almost 11 years
    This does not work on Server 2012, you need to turn the Windows Feature on and off.
  • tocallaghan
    tocallaghan almost 11 years
    Thank you! Might save someone some time: <system.webServer><modules runAllManagedModulesForAllRequests="true"><!-- ... --></modules></system.webServer>
  • albattran
    albattran almost 10 years
    Wow, I spent hours and couldn't figure it out, turned out it was some fluke that created a file with the same name like you did by mistake. Thanks!