Tuesday, January 11, 2011

VB Core – New compilation mode in Visual Studio 2010 SP1

While most servicing releases do not include new functionality, Visual Studio 2010 SP1 introduced an important new compiler feature that enables Visual Basic to target new platforms that were not previously supported.   This was mentioned in some of the initial SP1 blog posts such as Jasonz blog.  
This is a strategic investment by Microsoft in the future of VB.  This provides VB with an increased agility in the future for new platforms to support Visual Basic.
This blog provides more information about the feature; let me know if you have more questions.

WHAT IT IS?
The new command line option /vbruntime* (with an asterisk) will embed a reduced version of the Visual Basic runtime into the compiled assembly and therefore eliminate the dependency on the VB Runtime assembly since this assembly does not ship on all .Net platforms such as Windows Phone 7 and XNA.
The feature can be used from the VBC command line compiler or by adding an entry <VBRuntime>Embed</VBRuntime> into the .vbproj file.
In general, its intended use is only for specific project templates that target platforms that don’t ship with a VB runtime.

WHEN SHOULD I USE IT?
The simple answer to this is you should never need to use this directly.   The feature has been implemented to allow Microsoft Partner teams to create Visual Basic project templates for platforms that previously didn’t support VB. When such VB project templates eventually become available, you as a VB developer will be able to do File>New Project for the new project types, and /vbruntime* will be used under-the-hood.

Read more: The Visual Basic Team