I’m now going to compile this on the command line. Paste the complete code
into notepad and save it in it’s own directory. Now create a .bat file in the
same directory and paste this into it:-
%windir%\Microsoft.NET\Framework\v1.0.3705\vbc.exe
/target:winexe /out:frmMain.exe
/r:system.dll,system.drawing.dll,system.windows.forms.dll frmMain.vb
O.k. what the hell is this I hear you cry. Well this is a call to the VB.Net
compiler vbc.exe using the generic %windir% to get your windows directory. Note
you should check you are using v1.0.3705 of the framework otherwise the directory
may be different and may not even work. I then specify with switches what I want.
I want it to create a Windows Executable - /target:winexe, to create an exe called
frmMain.exe - /out:frmMain.exe, I’m referencing various .dlls using the /r which
can also be /reference and finally the file to compile is frmMain.vb.
Run this batch file and it should create frmMain.exe in the same directory.
Run that exe and it should be exactly the same as what you created in VS.Net.
VS.Net Is referred to as an IDE. That is it is an aid to creating .Net applications
and as such is not an absolute requirement to do so.
O.k. I hope this helped, I hope it didn’t confuse and if it didn’t work then
let me know and I’ll see if I can sort out where you’re going wrong. I’ve been
a long time VB/Asp Developer and I have to admit I’m very excited about .Net.
It’ll take some time to get a grasp of everything you can do with it but I think
it’ll be well worth it.
Happy Programming.
Comments