A couple of weeks ago, I promised to post the VB.NET equivalent to my C# command line example. Today, I'm going to show you how to do the same thing with the VB.NET command line compiler. In the C# post, I suggested adding the following environment variable to your sdkvars.bat file:
set NETCFLIBS="c:\program files\microsoft.net\sdk\v2.0\compactframework\windowsce"
I reference the same environment variable in the example shown below.
This example builds a very simple VB.NET application which makes use of Windows Forms and Web Services. As with the C# example, the non-bold portions of this example are the source file and resulting executable name.
vbc.exe /noconfig /netcf /nostdlib /target:exe /sdkpath:%NETCFLIBS% /r:mscorlib.dll /r:system.dll /r:system.drawing.dll /r:system.windows.forms.dll /r:system.web.services.dll /r:Microsoft.VisualBasic.dll /out:SimpleApp.exe Module1.vb
For details regarding the command line switches, please use vbc /?.
/sdkpathThis handy switch allows you to shorten each one of the /r (short for /reference) switches to just the name of the assembly (rather than the more cumbersome fully qualified assembly path).
Well, that's all for today... enjoy!-- DK
Disclaimers:This posting is provided "AS IS" with no warranties, and confers no rights.Some of the information contained within this post may be in relation to beta software. Any and all details are subject to change.