Does Visual Studio 2015 support older versions of MVC?
Asked Answered
S

3

45

Does Visual Studio 2015 support the older versions of MVC:

  • MVC3
  • MVC4
  • MVC5

Not all hosting environments support the newer versions of MVC, so to support needs of older infrastructure this is required.

If it is supported how do you create new solutions using the older MVC versions in Visual Studio 2015? By default new MVC projects are created as version 5.2.

Stochastic answered 8/5, 2015 at 12:14 Comment(9)
MVC 5.2 is the currently supported package. You can open an existing project using an earlier version of MVC in Visual Studio 2015. But why you would ever want to create a web app in an earlier version of MVC today in any IDE, 2015 or otherwise, is beyond me.Horatio
If you search the gallery, there may be an MVC3 or 4 template somewhere.Caterpillar
But i had a requirement to do so. VS 2010-mvc2,mvc3. VS2012-mvc3,mvc4. VS-2013-mvc4,mvc5. likewise VS2015 supports which versions of mvc?Stochastic
Cleaning up for readability and clarifying the need to prevent flaming.Lenard
I have not used/downloaded VS2015 but the different versions of MVC from v3 are available through NuGet, so you start with an empty template, and install the Nuget package for the version of MVC that you like instead of the default that comes with the MVC template, or ASP.NET 5 template.Natashianatassia
I noticed issues working on an older MVC3 web app...I am getting compiler errors, only in the editor, when trying to compile with a .CSHTML page open. It doesn't seem to recognize the references to MVC objects such as ViewBag from the CSHTML. This doesn't happen for me on newer versions of MVC or with VS2013. If the CSHTML page is close, the compile is successful.Acquisitive
If a hosting environment does not support MVC5 yet (which was released in 2013), I say... ditch that hosting!Zennie
In what way would a hosting environment not support mvc6? Can't you just bin deploy the required dll's?Spherics
This is an old thread, but I am sitting with the same issue. Currently developing in MVC 5 and requires Full Trust Levels, so hosting on a partial hosting environment(shared hosting) will not work. I have tried bin deploy, but made no difference. I can not ditch the SP as there is a 3rd party involved that is doing the hosting. So I need to use an older version of MVC(which I DONT want to do) - but what other option do I have if I can not change the SP ?Geithner
P
32

Does Visual Studio 2015 support the older versions of MVC?

Yes, It support them just after a migration (for adding/supporting new features in IDE like Intellisense and etc).

how do you create new solutions using the older MVC versions in Visual Studio 2015?

This is not an intellectual action since the newer platforms have a lot of fixes and advantages rather than prior ones. Unless, you may be forced to use an older one due to lack of hosting support, In this case you can't Create an older version of MVC project by the IDE (VS 2015) itself, unless by adding older assembly references and some handy works in configuration based on your complete awareness of older required files and architecture, since the newer IDE usually don't have the previews references.

Note: The VS 2015 is just an IDE (Integrated Development Environment). You can run any MVC version on it (with above considerations), But the IDE's new features will be limited likely. For example, the result of MVC 4 migration in VS 2015 will be:

ASP.NET MVC 4 projects have limited functionality in Visual Studio Next. Commands such as Add Controller, Add View, Add Area, and Go to View/Controller are not available. Intellisense for Razor (CSHTML and VBHTML) files is limited to HTML markup. Please see http://go.microsoft.com/fwlink/?LinkID=320968 for additional information on how to upgrade an MVC 4 project.

Which suffers from the lack of Intellisense and etc. But you can still run/develop the project with it or another IDE like Visual Studio Code and debugging the projects will make sense here.

Parch answered 26/7, 2015 at 12:51 Comment(4)
VS2015 doesn't support MVC 3. It's missing razor support among other things. Van Kichline's answer is the correct one.Capsulate
@Capsulate What's the complete definition for "Support" keyword? Do you mean Razor is a strange thing in VS?! Or lack of Intellisense?Parch
when someone asks if visual studio supports old versions of MVC i'd expect that to mean are the normal features that make up MVC functionality in VS supported. Razor syntax and intellisense are definitely part of that.Capsulate
@Capsulate So what's the definition of normal features that make up MVC functionality as you said? I think you're not educated enough. And you have not enough attention to my answer where I said "after a migration ...". Chatting about an answer is forbidden here.Parch
L
22

Visual Studio 2015 RTM supports MVC 5 and MVC 6 only; tooling and Razor support are missing for MVC4 and earlier versions. Note that MVC4 projects will be migrated automatically and should compile and run on VS 2015 RTM, but the editing experience in Razor views will be poor.
There has been significant negative feedback concerning this change since release, and the team is planning to ship MVC4 support for 2015 RTM. Watch the WebDev Blog for an official announcement soon.
The Send-a-Smile feature in Visual Studio 2015 is responsible for the rapid acquisition of this feedback and the decision to respond quickly. Consider using Send-a-Smile if feature changes impact you negatively.

Latish answered 31/7, 2015 at 21:9 Comment(1)
Update 1 has shipped, and MVC4 projects are now fully supported. You cannot create new MVC4 projects in VS 2015, but you can do everything else with them after installing the update.Latish
P
10

The Visual Studio 2015 Update 1 RC should support MVC 4 projects. See https://msdn.microsoft.com/en-us/library/mt591926.aspx

Penny answered 3/11, 2015 at 9:34 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.