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.
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
.
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.
The solution for me was to now try to change the name of _Layout.cshtml
file.
http://www.asp.net/mvc/tutorials/older-versions/deployment/using-asp-net-mvc-with-different-versions-of-iis-cs
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.
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!
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.
a) ASP .NET MVC
b) ASP .NET Web Pages with Razor syntax
(Press OK and Publish the project)
The element "runAllManagedModulesForAllRequests" of the web.config should be = "true". (By Default it is TRUE)
Under IIS 7.5 "Basic Settings" check if the website has Application pool like "ASP.NET v4.0"
Make sure if you downloads ALL files from the BIN folder. Sometimes FileZilla gets stuck... So, check it twice.
I hope this will help! :)