Adding an MVC project to an existing web application with .Net 4 - asp.net-mvc

I have an existing old WebForms application.
I need to add an MVC project.
The server where it is hosted is Windows 2003 R2, so only .Net 4 can be used.
And we use VS 2017.
I tried to add the project, but there is only "Empty" option available, and the "MVC" checkbox below is disabled, as well as "Web Forms" and "Web API".
Could you please tell how I can add an MVC project?

Presumably you need to download the ASP.NET MVC 4 installer.
The bigger question is, why not spin up an additional webserver which can support newer versions of .net?

Related

How to create a ASP.NET MVC web application project in VS2012

I am using Windows 8, and Visual Studio 2012. I need to create a ASP.NET MVC web application. But, when i click on Project types --> visual C# i only see windows store and not Web (as seen in VS 2008).
How can i create a MVC web application ? Help
I suspect you are using Visual Studio Express for Windows 8?
If so, you will also need Visual Studio Express for Web in order to create your MVC app.
See the different versions here: http://www.microsoft.com/visualstudio/eng/products/visual-studio-express-products
u can also user WebMatrix to create aps.net mvc project
it's free tool for asp.net from microsoft
u can get WebMatrix from here http://www.microsoft.com/web/webmatrix/
During the install, there should have been options, one of which was Visual Web Developer. Make sure that was installed (that was what it was called in VS 2010).

Is MVC4 baked into .NET 4.5?

A lot of release notes for Visual Studio 2012 talk about .NET 4.5 and MVC4, but I can't tell if MVC4 is actually part of the .NET 4.5 release. Anybody know for sure? I would love not to have to install MVC separately on my server.
No, ASP.NET MVC 4 is baked into VS2012, exactly the same way ASP.NET MVC 3 was baked into VS2010 but not part of .NET 4.0 (there was a separate download that you could install on your servers). But there will also be a separate download of ASP.NET MVC 4 for VS2010 SP1 in which you obviously won't be able to use the .NET 4.5 specific features, such as async/await, but you will still be able to develop an ASP.NET MVC 4 application and target .NET 4.0.
ASP.NET MVC has made a point of NOT being tied to a particular .NET incarnation. That way, you can use the latest and greatest irrespective of what .NET version your hosting provider uses.
If the provider supports ASP.NET, that's all you need to know.
For this precise purpose, ASP.NET MVC is bin-deployable, meaning you can deploy the MVC dlls yourself, along your application - without requiring special rights from the hosting provider.
Phil Haack has a great article describing how to bin-deploy MVC3. There's even tooling support in VS for this scenario!
I assume the workflow for newer MVC incarnations is similar.

Move MVC application in VS2008 to windows azure

I am new to Azure.I have MVC application build in VS 2008. It does not uses any database. How can I migrate the application to windows azure.
Which SDK and tool kit i should use.
Do i need to upgrade my app to 2010 before migrating
Is there any built in support for MVC
What role I should use
Thanks
Ank
Windows Azure hosts various roles, one of which is a WebRole. You can easily place an MVC project into this role for hosting on Azure.
Firstly, you will need to upgrade to VS2010 as I believe the latest SDK (Version 1.4) only supports VS2010. Download that from here http://www.microsoft.com/downloads/en/details.aspx?FamilyID=7a1089b6-4050-4307-86c4-9dadaa5ed018&displaylang=en
Once you have it installed, you create a Cloud project in VS. You then add your existing MVC projects to this solution. You then add a web role to the Cloud project you created and select your MVC project as the target.
There are a few things extra you need, such as setting copy-local on some referenced assemblies.
Here is an excellent post on the subject: http://blogs.msdn.com/b/jnak/archive/2008/10/28/asp-net-mvc-projects-running-on-windows-azure.aspx
Which SDK and tool kit i should use.
1.4 is the latest download link
Do i need to upgrade my app to 2010 before migrating
yes, SDK 1.4 does not support 2008
Is there any built in support for MVC
yes you will find a ASP.NET MVC 2 WebRole template`
What role I should use
this depends, try starting with Extra Small

ASP.net MVC 3 project files not showing up in new project dialog?

I installed ASP.net MVC 3 on my dev machine yesterday using the web-based installer, did a clean reboot, etc.
The MVC 3 projects still don't appear in my New Project dialog, only the MVC 2 ones. Am I missing a step?
The answer (in this case): Make sure you have the .net 4 runtime selected at the top of the new project dialog.
If you're using Visual Studio 2008, it won't show up since it's available for VS 2010 / .NET 4 only. If however you are using VS 2010 and .NET 4, they should appear unless something wonky occurred with the install.

Odd Things of ASP.NET MVC Deployment on IIS 6

Recently, I am a bit interested in the deployment of ASP.NET MVC application on IIS6 because Phil Haack posted an easier way to deploy ASP.NET MVC application on ASP.NET 4. So I decided to see how different version of ASP.NET MVC works on different version of ASP.NET.
First off, I created an ASP.NET MVC 2 project in Visual Studio 2010 and deploy it to IIS 6 on Windows Server 2003 (only .NET framework 3.5 installed). I set the application to run in ASP.NET 2.0 and no extra stuff. Because I just wanted to see what sort of error would occur. And as expected, some error was reported as following.
Then, I set the Copy Local attribute of System.Web.Mvc assembly to true as following and deploy again.
As a result, the application ran smoothly.
I had read tons of materials talked about the mess of deploying MVC application on IIS 6. And I did fight to tackle the deploying issues in my previous project. At least, if had used Extensionless Url in your application, you should have configured wildcard mapping in IIS. But in this case, I even didn’t have chance to do so.
What the heck was going on exactly? Did I discover a new continent?
Perhaps your IIS is configured with a wildcard module mapping. With other words, the request path ".*" is being send to the asp.net ISAPI module.

Resources