Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Which .NET framework with MVC 4?

Tags:

I have just installed MVC 4 and am looking at using it with VS 2010. I notice that by default when creating a project the .NET framework is 4.0, yet the example code I am looking at uses framework 4.5. If I want to utilise all the features of MVC 4 do I need to install framework 4.5, or should 4.0 be enough?

EDIT : Seems like I will go with 4.0, although will 4.5 be the default framework in VS2012? If so, I would probably prefer to install that to save having to make framework changes later.

like image 229
user517406 Avatar asked Aug 23 '12 09:08

user517406


People also ask

Does .NET framework use MVC?

MVC with ASP.NETASP.NET gives you a powerful, patterns-based way to build dynamic websites using the MVC pattern that enables a clean separation of concerns.

What is Microsoft ASP.NET MVC 4?

ASP.NET MVC 4 is a framework for developing highly testable and maintainable Web applications that follow the Model-View-Controller (MVC) pattern. The framework encourages you to maintain a clear separation of concerns— views for UI, controllers for handling user input, and models for domain logic.


2 Answers

Look at the MVC4 download page. There is a requirements section saying:

Supported operating systems: Windows 7, Windows Server 2003, Windows Server 2008, Windows Server 2008 R2, Windows Vista, Windows XP

.NET 4, ASP.NET 4, Visual Studio 2010 or Visual Web Developer 2010 are required to use certain parts of this feature.

like image 68
Steve Avatar answered Sep 19 '22 21:09

Steve


You need .NET 4 and Visual Studio 2010 at a minimum but CAN use more features with ASP.NET 4.5.

VS2010 will only support framework 4 features, and thus async/await will not be supported. For those features you need ASP.NET 4.5. This applies to the Web API as well for example this requires 4.5: http://blogs.msdn.com/b/henrikn/archive/2012/03/03/async-mashups-using-asp-net-web-api.aspx

A standard controller/view scenario in MVC4 will work in VS2010 on ASP.NET 4.

like image 30
Adam Tuliper Avatar answered Sep 18 '22 21:09

Adam Tuliper