Even though we announced the release of MVC 2 (for Visual Studio 2008) on March 12, we are still working on getting a few more goodies out. And although not as awesome as canned unicorn meat (I don’t think anything can beat that), it is still very exciting. Today we released the source code of MVC 2 to the Microsoft source and symbol servers. Those of you using Visual Studio 2008 can now debug your applications and step into the MVC 2 RTM source code. If you are using one of the preview versions of MVC that shipped with prelease versions of Visual Studio 2010 then you will need to be a bit more patient until the final product ships since the assembly you are using needs to match the RTM version.
If you haven’t configured Visual Studio for source stepping then I suggest you take a look at Shawn Burke's post. It should only take you a few minutes to get up and running.
A full list of products that are on the reference servers can be found here. As some of you may recall, we had a small incident when we released the sources for MVC 1.0. Whenever you stepped into the source, the debugger would be off by two lines. The reason for this is that the copyright header injected by the tool we use to extract the source code from our source control system were placed at the top of each file, instead of the bottom. We’ve made sure not to repeat that mistake for MVC 2.
After configuring Visual Studio to use the Microsoft reference server for source stepping you can create a new MVC 2 application (or use an existing MVC 2 application) and set a breakpoint.
Hit F5 and wait for the debugger to hit the breakpoint, then open the Call Stack window.
If the entries for System.Web.Mvc are grayed out then right click and select Load Symbols. Once the entries light up, double click on one of the MVC methods in the call stack to view the source. It might take a while the first time to download the source, but once it’s done, Visual Studio will cache it locally on your machine.
But Wait, There’s More…
Over the last couple of weeks we also wrapped up the localized releases of MVC 2 for Japanese, German and French and we continue to work on the other official VS languages (Spanish, Italian, Russian, Korean and Chinese).
The localized versions of MVC will only be available in Visual Studio 2010 and includes localized versions of intellisense (including jQuery), tooling, templates (except T4) and the runtime. Since the runtime component of MVC 2 is shared between 2008 and 2010, you will be able to make use of the localized runtime resources in your application when developing in Visual Studio 2008 if you have a side-by-side installation of Visual Studio 2008 and a localized version of Visual Studio 2010.