Wednesday, June 21, 2006

Compile VB.NET code without the implicit reference to Microsoft.VisualBasic.dll

Background
As you all know, Visual Basic.NET enables you to code using VB6 legacy syntax and keywords.
For example CInt, Mid, InStr etc’
The implementation of that compatibility layer is at the Microsoft.VisualBasic.dll.

Goal
Let’s say you are developing a program using Visual Basic.NET (stop hurling and stop value languages by the amount of semi columns they contains :)
And your wish to make sure that your code is using “pure” .NET and VB6 free.

Behind the scene
When compiling your program, using either VS IDE or the vbc command line compiler, the Microsoft.VisualBasic.dll is added as a reference, and there is no direct approach of removing this reference.

The official (and quite not reasonable) solution to the problem is to add the –sdkpath command line option to the vbc (you cannot set this option at VB Visual Studio project)

Copy the .NET Platform assemblies that required by your project references, into a different directory, and build your program from command line, having the –sdkpath pointing to that directory.


(Aough..)


Behind the whole Theater
There is an undocumented vbc command line option –novbruntimeref, which you can use as an alternative to -sdkpath.

Adding -novbruntimeref excludes the implicit addition of Microsoft.VisualBasic.dll reference.


Enjoy and Deploy.

Sunday, June 18, 2006

Go Skateboarding Day

On June 21 skateboarders around the globe will celebrate the pure exhilaration, creativity, and spirit of one of the most influential activities in the world by blowing off all other obligations to go skateboarding!

Skateboarders everywhere will hold fundraisers, contests, protests, demo’s, they’ll skate across cities, gather in skateparks, stream into their local skate shop and some will even revel in the solitary act of skateboarding alone, all bringing together the skateboarding community in the grind heard around the world.