VS10 Beta 2 From an ASP.NET MVC Perspective

You probably don’t need me to tell you that Visual Studio 2010 Beta 2 has been released as it’s been blogged to death all over the place. Definitely check out the many blog posts out there if you want more details on what’s included.

This post will focus more on what Visual Studio 2010 means to ASP.NET MVC and vice versa.

Important: If you installed ASP.NET MVC for Visual Studio 2010 Beta 1, make sure to uninstall it (and VS10 Beta 1) before installing Beta 2.

In the box baby!

Well one of the first things you’ll notice is that ASP.NET MVC 2 Preview 2 is included in VS10 Beta 2. When you select the File | New menu option, you’ll be greeted with an ASP.NET MVC 2 project template option under the Web node.

New Project

Note that when you create your ASP.NET MVC 2 project with Visual Studio 2010, you can choose whether you wish to target ASP.NET 3.5 or ASP.NET 4.

multi-target

If you choose to target ASP.NET 4, you’ll be able to take advantage of the new HTML encoding code blocks with ASP.NET MVC which I wrote about earlier.

As an aside, you might find it interesting that the System.Web.Mvc.dll assembly we shipped in VS10 is the exact same binary we shipped out-of-band for VS2008 and .NET 3.5. How then does that assembly implement an interface that is new in ASP.NET 4? That’s a subject for another blog post.

What about ASP.NET MVC 1.0?

Unfortunately, we have no plans to support ASP.NET MVC 1.0 tooling in Visual Studio 2010. When we were going through planning, we realized it would’ve taken a lot of work to update our 1.0 project templates. We felt that time would be better spent focused on ASP.NET MVC 2.

However, that doesn’t mean you can’t develop an ASP.NET MVC 1.0 application with Visual Studio 2010! All it means is you’ll have to do so without the nice ASP.NET MVC specific tooling such as the add controller and add view dialogs. After all, at it’s core, an ASP.NET MVC project is a Web Application Project.

Eilon Lipton, the lead dev for ASP.NET MVC, wrote a blog post a while back describing how to open an ASP.NET MVC project without having ASP.NET MVC installed. All it requires is for you to edit the .csproj file and remove the following GUID from the <ProjectTypeGuids> element.

{603c0e0b-db56-11dc-be95-000d561079b0};

Once you do that, you’ll be able to open, code, and debug your project from VS10.

Upgrading ASP.NET MVC 1.0 to ASP.NET MVC 2

Another option is to upgrade your ASP.NET MVC 1.0 application to ASP.NET MVC 2 and then open the upgraded project with Visual Studio 2010 Beta 2.

Eilon has your back again as he’s written a handy little tool for upgrading existing ASP.NET MVC 1.0 applications to version 2.

After using this tool, your project will still be a Visual Studio 2008 project. But you can then open it with VS10 and it knows how to open and upgrade the project to be a VS10 project.

What about automatic upgrades?

We are investigating implementing a more automatic process for upgrading ASP.NET MVC 1.0 applications to ASP.NET MVC 2 when you try to open the existing project in Visual Studio 2010. We plan to have something in place by the RTM of VS10.

Ideally, when you try to open an ASP.NET MVC 1.0 project, instead of showing an error dialog, VS10 will provide a wizard to upgrade the project which will be somewhat based on the sample Eilon provided. So be sure to supply feedback on his wizard soon!

What others have said

Requesting Gravatar... Javier Lozano Oct 20, 2009 9:39 PM
# re: VS10 Beta 2 From an ASP.NET MVC Perspective
Thanks for the post, Phil! Clears up some questions and provides some direction as RTM approaches!
Requesting Gravatar... Kevin Dente Oct 20, 2009 9:59 PM
# re: VS10 Beta 2 From an ASP.NET MVC Perspective
What's the plan for future MVC CTPs (assuming there are more coming)? Will they be supported on both VS2008 and VS2010 beta 2? Only VS2008?
Requesting Gravatar... Haacked Oct 20, 2009 10:12 PM
# re: VS10 Beta 2 From an ASP.NET MVC Perspective
Now that ASP.NET MVC 2 is included in Visual Studio 2010, we will not ship any updated out-of-band previews for VS10. Your next look at MVC for VS10 will be whatever ends up being the next release of VS10.

We will have another preview version of ASP.NET MVC in between now and the next release of VS10, and that one will only support VS2008.
Requesting Gravatar... Jack Oct 20, 2009 10:36 PM
# re: VS10 Beta 2 From an ASP.NET MVC Perspective
"we have no plans to support ASP.NET MVC 1.0 tooling in Visual Studio 2010", we do hope VSTS will release all its component together, or it may result in some unexpected problems.
Requesting Gravatar... Chirox Oct 20, 2009 11:05 PM
# re: VS10 Beta 2 From an ASP.NET MVC Perspective
Thanks! This is Good
Requesting Gravatar... jxm Oct 20, 2009 11:33 PM
# re: VS10 Beta 2 From an ASP.NET MVC Perspective
???!
Requesting Gravatar... anton Oct 21, 2009 1:53 AM
# re: VS10 Beta 2 From an ASP.NET MVC Perspective
Got this error when firing a spanking new installation of VS10!

The type or namespace name 'Mvc' does not exist in the namespace 'System.Web' (are you missing an assembly reference?) C:\Users\Anton\Desktop\MvcApplication1\MvcApplication1\Controllers\HomeController.cs 5 18 MvcApplication1

Where do i find the correct references?
Requesting Gravatar... Paul Blamire Oct 21, 2009 1:59 AM
# re: VS10 Beta 2 From an ASP.NET MVC Perspective
Hey Phil,

If VS2010 beta 2 includes MVC2 preview 2 and has an explicit go live license, are there any plans for an explicit go-live for the out-of-band release for VS2008.

Thanks,
Paul
Requesting Gravatar... Jonty Oct 21, 2009 3:01 AM
# re: VS10 Beta 2 From an ASP.NET MVC Perspective
In the release notes of MVC 2 preview 2, it says you can't use it side by side with MVC 1.0. Is this true? If I install VS2010 beta 2, will my current MVC 1.0 applications break?

Will VS2010 RTM include MVC 2.0 RTM?
Requesting Gravatar... Koistya `Navin Oct 21, 2009 4:16 AM
# re: VS10 Beta 2 From an ASP.NET MVC Perspective
Great news! ^_^
Requesting Gravatar... MartinF Oct 21, 2009 8:34 AM
# re: VS10 Beta 2 From an ASP.NET MVC Perspective
Great.

What about setting up Areas in VS 2010 and where do i enable build views ? (still manually through the project file?)
Requesting Gravatar... Haacked Oct 21, 2009 8:25 PM
# re: VS10 Beta 2 From an ASP.NET MVC Perspective
@Jonty that must be a typo. ASP.NET MVC 2 is completely side-by-side with ASP.NET MVC 1.0
Requesting Gravatar... Ian Joyce Oct 21, 2009 8:45 PM
# re: VS10 Beta 2 From an ASP.NET MVC Perspective
How about an empty asp.net mvc 2 web application?
Requesting Gravatar... andrew rome Oct 22, 2009 1:40 AM
# re: VS10 Beta 2 From an ASP.NET MVC Perspective
Phil,

I'm struggling to get MVC working with 2010 b2. It announced an error around around MVC, and now wont work with any MVC2 projects. Dissapointing. It relates to beta one being installed. MVC 1.1 seems to be the culprit, but it won't let me uninstall that. Are there any easy fixes?

A
Requesting Gravatar... Pikesville Paesano Oct 22, 2009 9:49 AM
# re: VS10 Beta 2 From an ASP.NET MVC Perspective
Yes, but can I get it with bacon?!?

Requesting Gravatar... Bret (RunXc) Oct 23, 2009 10:52 AM
# re: VS10 Beta 2 From an ASP.NET MVC Perspective
I have seen that there is a Go-live license for Visual Studio 2010 beta 2. I am wondering how mature ASP.NET MVC 2 beta 2 is. I am currently creating a MVC app that won't go live until say January of next year. How safe would I be in upgrading to Visual Studio 2010 and ASP.NET MVC 2 now?
Requesting Gravatar... John McKenna Oct 23, 2009 12:51 PM
# re: VS10 Beta 2 From an ASP.NET MVC Perspective
Looking forward to MVC 2.0 on 2010!
Requesting Gravatar... feng Oct 26, 2009 3:06 PM
# re: VS10 Beta 2 From an ASP.NET MVC Perspective
Is there any plan to support Website project type? As Web Application project type is not up to our enterprise application standard.
Requesting Gravatar... Christian Oct 27, 2009 2:04 AM
# re: VS10 Beta 2 From an ASP.NET MVC Perspective
Nice. I can't wait for final. I try the beta and i love it :D
Requesting Gravatar... Schmuli Oct 29, 2009 7:48 AM
# re: VS10 Beta 2 From an ASP.NET MVC Perspective
I haven't seen anybody mention it yet anywhere, but when I tried installing VS2010B2, the installer failed for MVC2, and now VS2010 doesn't recognize (find) the MVC2 dll. The MVC tools was installed, so I can create a project, but it can't compile because of the missing dll, which I can't add manually as VS2010 can't seem to find it (even MVC1(1.1) dlls). I tried reinstalling VS2010 but that didn't help at all, as it didn't even try to install MVC2 at all.

Another issue I noticed but which may not be an issue (I didn't test it yet), is that the MVC templates are installed under the "Visual Studio 2010" folder, but all the rest of VS2010's folders appear under the "Visual Studio 10" folder. Is this an issue?
Requesting Gravatar... coder Oct 31, 2009 5:52 PM
# re: VS10 Beta 2 From an ASP.NET MVC Perspective
are there any compatibility issues with windows7 and beta2?
Requesting Gravatar... Raj Athth Feb 27, 2010 1:16 AM
# re: VS10 Beta 2 From an ASP.NET MVC Perspective
I just downloaded the VS2010 RC and MVC 2. Then opened up VS 2010, and changed the .NET framework configuration to 3.5.

I thought of creating the MVC2 "Hello World!" project. But I realized there is no standard "HomeController", or "Index" View even the RegisterRoutes says..

routes.MapRoute(
"Default", // Route name
"{controller}/{action}/{id}", // URL with parameters
new { controller = "Home", action = "Index", id = "" } // Parameter defaults
);

I really don't need 'em, but I'm just curious why MVC team decided to remove the startup controllers from the templates. Or am I missing something from the installation?
Requesting Gravatar... haacked Feb 27, 2010 4:24 PM
# re: VS10 Beta 2 From an ASP.NET MVC Perspective
@Raj There are two project templates. Did you by chance use the "Empty" one and not the standard one?
Requesting Gravatar... Raj Athth Mar 01, 2010 3:13 AM
# re: VS10 Beta 2 From an ASP.NET MVC Perspective
Oops Yes! Thanks a lot Phil.

What do you have to say?

(will show your gravatar)
Please add 7 and 4 and type the answer here: