Tuesday, November 16, 2010

How come I can't make a simple .exe file in visual basic express edition 2008 like in vb 6?

When I publish the program, I get a whole set of files. And when I try to run the program in another machine, I get a message asking me to install the .NET framework! Can't I just make a simple .exe so that I can run it without spending about 1hour downloading .NET?How come I can't make a simple .exe file in visual basic express edition 2008 like in vb 6?
Once you get to VS 2008 then VB is only a .NET environment - you cannot create a standalone VB program like that (or not easily anyway). MS decided to do that because once you get to Vista and Windows 7 the .NET framework will be already available to the user.How come I can't make a simple .exe file in visual basic express edition 2008 like in vb 6?
When you build or run an application, the EXE is automatically created and placed in the MyProject/MyProject/bin/Debug folder. So if your application is called Fish and you chose to save in the C drive, the folder the EXE is in is C:\Fish\Fish\bin\Debug.



You can run the EXE anywhere as long as the target computer has the version of the .Net framework that your application is using. Most computers nowadays have this, so you don't have to worry much. So .Net will have to be installed, but your application won't need to be.
You can't do that in VB6 either. You need any controls you add to the program, and you need the VB6 runtime installed. The exe calls library routines in msvbvm60.dll in VB6 or .net in VB.net. If you copy the exe from a VB6 project to a computer without the runtime or one of the controls, you'll get an error when you try to run it. (Since the runtime and most of the controls are part of XP, most people who aren't familiar with early versions of Windows have never run into the problem. But if you write a VB6 program using Office controls, and install it on a computer that doesn't have Office, it won't work either.)
VB 2008 runs off the .NET framework, and any program you compile will require .NET. Why do you think it would take an entire hour downloading .NET? Perhaps you need a faster connection. Modems are painfully slow.



If I remember correctly, there is an option to allow the compiled ZIP file contain everything the end user needs (including any DLLs, .NET, and anything else the program would require.) I don't remember where that option is, but I'm fairly certain it's there somewhere.
VB6 isn't that simple anyway, it does have dependency to msvbvm60.dll



and not even C/C++ (that is compiled from Visual Studio, other compiler may vary) are free from msvcrt,dll (Microsoft Visual C Runtime)



only they are included in the newer version of Windows



since .NET was released after XP, it does not have .NET runtime by default...
There will be a compiled version of the program genereted each time you test it in Visual Basic. Just go to your My Documents\Visual Studio 2008\Projects\*Whatever Your Program's Called*\*Whatever Your Program's Called*\bin\Release\*Program*.exe

No comments:

Post a Comment