问题
I want to know about a thing that IS ASP.NET MVC 4 application can be run on .NET 4 server.
I am trying to deploy my MVC4 application and I am got the error that.
500 - Internal server error.
There is a problem with the resource you are looking for, and it cannot be displayed.
I target the .net 4 framework but I am still having this error. I am not sure what happen to server. I am trying to look on other post but I did not find any post who can clearify that MVC 4 can run on .net server.
回答1:
Yes. ASP.Net MVC 4 will run on ASP.Net 4 and ASP.Net 4.5. I am running a site on ASP.Net 4, and it is also confirmed in this blog post by Scott Gu. This assumes that you are not targeting any new 4.5 features in your application.
Be sure that you are copying the required MVC 4 .dll files in your bin folder if the server does not already have them installed. This post by Phil Haack explains how to bin deploy version 3. Hanselman has a similar article. You will need to check the version 4 release notes for the current .dlls required.
We may be able to provide a more specific answer if you can provide some additional details, and let us know what version of IIS and Visual Studio you are running.
回答2:
- Right click your mvc4/webapi project ,choose the "Add Library Package Reference..." item, checked the "ASP.NET MVC" checkbox .
- Install DotNet Framework 4 Client Profile on your server.Because of the reference item "System.Net.Http" target framework is .net4 client profile.
- Publish your mvc4 project to your server
- enjoy......:)_
回答3:
Razor 2 is part of the next wave of the WebPages/MVC framework so it will require MVC4. There's nothing stopping you from using our Open-Source code to wedge Razor 2 in to MVC3, but it isn't a supported scenario.
Remember that MVC 4 works on .NET 4.0 and does NOT require .NET 4.5!
ASP.net mvc programmer blog
来源:https://stackoverflow.com/questions/9548283/can-i-deploy-my-asp-net-mvc-4-application-in-net-4