Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I deploy my ASP.NET MVC 4 application in .net 4

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.

like image 488
user1240424 Avatar asked Mar 03 '12 17:03

user1240424


People also ask

Is MVC 4 still supported?

We have many applications developed with ASP.NET MVC 4 and below versions. As per the Microsoft Support Policy, the retirement date for ASP.NET MVC is July 1st, 2019.

Which framework is best for ASP.NET MVC?

Angular JS Angular is the most-popular, most-used and most-discussed JavaScript Framework in context of web applications, and that too ASP.NET MVC applications.

Can we plug an ASP.NET MVC into an existing ASP.NET application?

Luckily, the answer is yes. Combining ASP.NET Webforms and ASP.NET MVC in one application is possible—in fact, it is quite easy. The reason for this is that the ASP.NET MVC framework has been built on top of ASP.NET.


3 Answers

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.

like image 193
Dan Sorensen Avatar answered Sep 30 '22 03:09

Dan Sorensen


  1. Right click your mvc4/webapi project ,choose the "Add Library Package Reference..." item, checked the "ASP.NET MVC" checkbox .
  2. Install DotNet Framework 4 Client Profile on your server.Because of the reference item "System.Net.Http" target framework is .net4 client profile.
  3. Publish your mvc4 project to your server
  4. enjoy......:)_
like image 24
azraelrabbit Avatar answered Sep 30 '22 02:09

azraelrabbit


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

like image 41
gdoron is supporting Monica Avatar answered Sep 30 '22 02:09

gdoron is supporting Monica