VS10 Beta 2 From an ASP.NET MVC Perspective

asp.net 0 comments suggest edit

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 controllerandadd viewdialogs. 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!

Tags: aspnetmvc, asp.net, visual studio 2010, visual studio

Found a typo or error? Suggest an edit! If accepted, your contribution is listed automatically here.

Comments

avatar

25 responses

  1. Avatar for Javier Lozano
    Javier Lozano October 20th, 2009

    Thanks for the post, Phil! Clears up some questions and provides some direction as RTM approaches!

  2. Avatar for Kevin Dente
    Kevin Dente October 20th, 2009

    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?

  3. Avatar for Haacked
    Haacked October 20th, 2009

    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.

  4. Avatar for Jack
    Jack October 20th, 2009

    "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.

  5. Avatar for Chirox
    Chirox October 20th, 2009

    Thanks! This is Good

  6. Avatar for jxm
    jxm October 20th, 2009

    ???!

  7. Avatar for anton
    anton October 20th, 2009

    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.cs518MvcApplication1
    Where do i find the correct references?

  8. Avatar for Paul Blamire
    Paul Blamire October 20th, 2009

    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

  9. Avatar for Jonty
    Jonty October 20th, 2009

    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?

  10. Avatar for Koistya `Navin
    Koistya `Navin October 20th, 2009

    Great news! ^_^

  11. Avatar for MartinF
    MartinF October 20th, 2009

    Great.
    What about setting up Areas in VS 2010 and where do i enable build views ? (still manually through the project file?)

  12. Avatar for Haacked
    Haacked October 21st, 2009

    @Jonty that must be a typo. ASP.NET MVC 2 is completely side-by-side with ASP.NET MVC 1.0

  13. Avatar for Ian Joyce
    Ian Joyce October 21st, 2009

    How about an empty asp.net mvc 2 web application?

  14. Avatar for andrew rome
    andrew rome October 21st, 2009

    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

  15. Avatar for Pikesville Paesano
    Pikesville Paesano October 21st, 2009

    Yes, but can I get it with bacon?!?

  16. Avatar for Bret (RunXc)
    Bret (RunXc) October 22nd, 2009

    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?

  17. Avatar for John McKenna
    John McKenna October 23rd, 2009

    Looking forward to MVC 2.0 on 2010!

  18. Avatar for feng
    feng October 26th, 2009

    Is there any plan to support Website project type? As Web Application project type is not up to our enterprise application standard.

  19. Avatar for Christian
    Christian October 26th, 2009

    Nice. I can't wait for final. I try the beta and i love it :D

  20. Avatar for Schmuli
    Schmuli October 28th, 2009

    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?

  21. Avatar for coder
    coder October 31st, 2009

    are there any compatibility issues with windows7 and beta2?

  22. Avatar for Raj Athth
    Raj Athth February 26th, 2010

    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?

  23. Avatar for haacked
    haacked February 27th, 2010

    @Raj There are two project templates. Did you by chance use the "Empty" one and not the standard one?

  24. Avatar for Raj Athth
    Raj Athth February 28th, 2010

    Oops Yes! Thanks a lot Phil.

  25. Avatar for Hhhkola
    Hhhkola January 11th, 2013

    <c><d>