Does Visual Studio 2015 support older versions of MVC? - asp.net-mvc

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.

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.

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.

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

Related

Change CRUD Scaffolder (Scaffolding) in Visual Studio 2019

I am using Visual Studio 2019, with .NET Framework 4.8, creating ASP.NET MVC 5 software (not Core).
I would like to use the CRUD Scaffolder from an older version of Visual Studio (e.g. 2017 or 2015). I have searched on internet and on Microsoft site; I cannot find anything. I do not have the older versions of software now.
In one of the older versions, the CRUD scaffolder created Views with simple code-
#Html.EditorFor(model => model.xxx)
#Html.EditorFor(model => model.yyy)
#Html.EditorFor(model => model.zzz)
along with of course the rest of the view code. And this is what I would like to do in VS 2019 (for just the scaffolded Views). I am looking to simplify the scaffolded view code (as was the case in older versions of VS).
QUESTIONS:
Is there a way to download and install/copy the older scaffolders?
If not the above, is it possible and easy to copy and modify the current VS2018 scaffolder code? Where could I find info on how to do it?
You will need to create custom scaffolding templates for that.
Here is a great link.
https://learn.microsoft.com/en-us/archive/msdn-magazine/2018/march/asp-net-use-razor-to-generate-html-for-templates-in-a-single-page-app
Scroll down to Changing the Scaffolding.
This is for VS 2017. The default template path in VS 2019 is C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\Extensions\Microsoft\Web\Mvc\Scaffolding\Templates\MvcView
You will also need to put everything in CodeTemplates\MvcView if you will be creating your own T4 template.
You will just have to install the older versions of VS to get their T4 Files.
Here is another great tutorial on how to do this.
Hopefully some of this helps.

.net mvc 5.2.3 does not work correctly in visual studio 2013

After upgrading my .net mvc project to 5.2.3, it does not have nice features like validating view/action names and linking to them.
here are my project type guids
<ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
which should mean web application + C# and probably is correct
I have Microsoft Visual Studio Ultimate 2013 Version 12.0.31101.00 Update 4
.net version is 4.5.51641
and tools which are probably related
ASP.NET and Web Tools 12.4.51016.0
ASP.NET Web Frameworks and Tools 2012.2 4.1.21001.0
ASP.NET Web Frameworks and Tools 2013 5.2.21010.0
do i need some additional extension or is there some secret project guid for mvc 5.2.3?
Try uninstalling the package. Then clean the solution and reinstall it again.
it turned out to be a resharper issue
https://youtrack.jetbrains.com/issue/RSRP-433112
have been using this tool for so long it seemed natural to have this kind of intellisense and started to blame visual studio.

Does Visual Studio 2010 support MVC 5?

My question is can we develop an application in Visual Studio 2010 using MVC 5?
If yes, please also mention the tutorial or sample code url with your answer.
If no, then please specify the requirements of MVC 5 to build an application with it?
No it isn't possible. You need Visual Studio 2012 and I thought .NET 4.5 at least. See the upgrade notes for detail information http://www.asp.net/mvc/tutorials/mvc-5/how-to-upgrade-an-aspnet-mvc-4-and-web-api-project-to-aspnet-mvc-5-and-web-api-2
You need VS 2012 or above to have MVC5 support.
From the EF Blog
Compatibility
This version of the NuGet package is fully compatible with Visual
Studio 2010 and Visual Studio 2012 and can be used for applications
targeting .NET 4.0 and 4.5.
Some features are only available when writing an application that
targets .NET 4.5. This includes enum support, spatial data types,
table-valued functions and the performance improvements.
I was able to add EF5 to an MVC4 project through NuGet. You can certainly use MVC 4, you just won't get all the new features unless you're on VS2012.
Difference MVC3 VS MVC4

Create and Run MVC 5 Project in VS 2012

For some reason my Visual Studio 2013 Preview cannot create MVC 5 Projects. Since the MVC project is now open source in CodePlex I was wondering if there's a simple way to develop MVC 5 projects in my Visual Studio 2012 Ultimate.
Microsoft has released updated Web Tools 2013.1 that provide the support:
Description
Direct download
Note that I had to install it manually from the second link, the tools did not install properly from Web Platform Installer. Also a colleague had to install both Update 4 and these tools to get proper support.
Original answer (not actual anymore):
I received this answer from Microsoft developer:
MVC 5/Razor 3 tooling support for VS 2012 has not shipped yet. We hope to ship this support in Mid November.
Recently ASP.NET Program Manager from Microsoft mentioned in a talk that this would be included in VS2012 Update 4. Edit: unfortunately the support is not in Update 4.
So the accepted answer is true for now but we can plan to soon have this support in VS2012 as well.
A new tutorial has been recently added to the ASP.NET website on how to upgrade an MVC4 project to MVC5.
I migrated a VS 2012 project using this tutorial without problems, but there is no design time support for Razor 3 in VS2012 due to changes in the way VS loads the razor engine.
You can edit razor pages in VS2012, but it will be a plain HTML editor.
Microsoft has released an update for this, Web Tools 2013.1 for VS2012.
http://blogs.msdn.com/b/webdev/archive/2013/11/18/announcing-release-of-asp-net-and-web-tools-2013-1-for-visual-studio-2012.aspx
I'm not sure MS will fix it.
The bug report says problem closed : by design
https://connect.microsoft.com/VisualStudio/feedback/details/806348/razor-intellisense-does-not-work-in-visual-studio-2012-after-upgrading-to-mvc-5-razor-3
and it is mid November
I have a tutorial that will not only get your empty MVC 5 project working with Bundling, a controller, jQuery, jQuery UI, Modernizr and more, but it will walk you through installing Zurb's Foundation 5, a responsive Framework which I have working with Sass in MVC 5. It's all here:
http://tinyurl.com/VS12-MVC5-F5
The problem many have ran into is that Visual Studio 2012 only allows you to start from a blank MVC 5 project, so I will help you get the NuGet installed which is pretty similar to the instructions in the NuGet package with a few minor changes; however, it does not take into consideration that you will be installing from Visual Studio 2012 using a Blank MVC 5 project. If you would like to use Foundation 5 with MVC 4 Web Application template just omit the Bootstrap uninstall and the NuGet package should work fine, but if you need to use MVC 5 and you don’t have Visual Studio 2013, you will need to build the Home Controller, Bundling class, modify the Global.asax.cs as well as other quirky little things. So lets get started.
I spent a good part of a few hours getting it all working.

ASP.NET MVC 1 to Azure migration

I have a web application built with ASP.NET MVC 1 in Visual Studio 2008.
How do I migrate this web application to Azure? All the tutorials are either for Visual Studio 2010 or don't work anymore. I've installed the Web Platform Installer and the Azure SDK, and in VS2010 the Azure project template is available, but not in VS2008. I've checked alot of guides, but all the download links on MSDN for anything Visual Studio 2008 related seem to be broken.
My idea was just to add an Azure deployment project to the solution, add the references to the right Azure libraries, and deploy, but I can't even get that far since I have no idea where to begin.
Much of the MVC stuff in my application is highly customized, making a migration to ASP.NET MVC 2/3/4 difficult. And since it's MVC 1, which has no tooling support for Visual Studio 2010, I would preferably avoid a migration to Visual Studio 2010.
You can go about this in two ways. You can either use cspack to package up the code and deploy to Azure or you can install an older SDK that supports Visual Studio 2008:
CSPack: http://msdn.microsoft.com/en-us/library/windowsazure/gg432988.aspx
Older SDKs: http://www.windowsazure.com/en-us/develop/downloads/archive-net-downloads/
I know 1.1 installed on VS2008 and I know 1.4 does not, not sure about the ones in between.

Resources