locked
How to perform release build and not debug build for exe

    Question

  • Hello,

    I have some very simple questions about making a release build exe in vb.net using MS VB 2010 Express.

    I realize that my project's executable is built in the bin/debug folder. However, when I copy this to any other location on my computer or someone else's, this executable does not function. I have read that I need to create a release build but in MS VB 2010 Express, when I use the Project-Properties menu and change the Compile tab configuration to Release and the path to bin\Release\, I still get the exe in the bin\Debug folder and not the bin\Release folder.

    1) Is it normal that exe's from the debug folder do not function outside of the debug folder?

    2) Most importantly, if the release build produces a faster exe, could someone please explain step by step how to do this with MS VB 2010 Express ? I do not see any button on the compile tab in the project properties that actually builds the release.

    Thank you!

    C

     

     

    Wednesday, August 04, 2010 3:55 PM

Answers

  • If you have any .dlls which are not set as embeeded resource (not sure if the same goes for compiled) then they should be copied with the .exe. You can see what the different files build action is, by selecting the file in the solution explorer and then look at the build action in the property window.

    I am not sure what would cause the error you get, so I can't help with that.

     ~ Bjoern

    Monday, August 09, 2010 7:47 PM
  • Hi

    I am not talking with authority here, but even with the Release exe, you will still need any dependancies copied over as well.

    I suffered greatly with a similar problem (some months ago), and with the help of the forum members I finally managed to get it sorted. In my case, it turned out to be a hard coded path in one of the dll's I was using and a single config line was the answer. I would *never* have managed to trace the problem myself.

    To give another example - I have a Scheduler project. The project uses some data files (no DLL's in this case). I can - and do - copy the Data Folder and the exe file from the Debug folder to another machine and it just works. No installation or anything.


    Regards from Livingston, Scotland (Please ignore any stupid formatting produced by this forum)
    Monday, August 09, 2010 8:07 PM
  • Hello,

    If you want release version of your exe, you should change from the compile tab configuration. You need change in the IDE, like the link what I showed below.

    https://adpyua.blu.livefilestore.com/y1paUi3dViyq9tKpEBAeeK6JTn2K1fdDyKeZnsQQccRKYzL7nltzf_EAYuzxJ_G9ENAL7FWdUS5JP9sxcHyOj2y3aHvDpkNRqc1/Release.jpg?psid=1

    To run your application in computer, you must have the computer with .net framework installed, and its dependents should also be deployed.

    Thanks

    Chao


    Please unmark it if it does not help, and mark it if it helps.
    Tuesday, August 10, 2010 12:02 PM

All replies

  • Hi

    I can't speak about the speed aspect of the release build, but I *think* it doesn't have some debug info in it compared to the Debug build. What I can say, is that I have/do use project exe's successfully from the Debug folder. I do need to copy over associated data/files/icons or whatever else the executable needs, but doing this results in everything working as I think you are expecting.

    In my case, for example, I have project that needs 2 dll's and a Common.Config file copied over along with the exe to enable it to work properly.


    Regards from Livingston, Scotland (Please ignore any stupid formatting produced by this forum)
    Wednesday, August 04, 2010 4:11 PM
  • First, how does the exe not function? What kind of error message?

    Also the build in the project settings is for the published project(?) and not the one created by running the program with the F5 key/ "play" button. To make the bin\release change the debug to the left of the debug/play button with release and then press the button to build it.

    Wednesday, August 04, 2010 4:17 PM
  • Hello Bjoern,

    It says my program 'has encountered a problem and needs to close. We are sorry for the inconvenience.' Then it asks if I should send or not send an error report with an option for debugging. 

    I agree with Leshay that I possibly need to copy the .dll files and some others to make it work. 

    Im still lost at where this debug button I must change is located. Sorry very new to VB.net! I see there are two build options, build a project and build the solution. Could you explain what the icon looks like? My icon to the left of the debug/play button is simply the redo command.

    Sorry for such a stupid question.

    Thank you in advance for your help.

     

    Cheers,

    C

    Monday, August 09, 2010 3:51 PM
  • If you have any .dlls which are not set as embeeded resource (not sure if the same goes for compiled) then they should be copied with the .exe. You can see what the different files build action is, by selecting the file in the solution explorer and then look at the build action in the property window.

    I am not sure what would cause the error you get, so I can't help with that.

     ~ Bjoern

    Monday, August 09, 2010 7:47 PM
  • Hi

    I am not talking with authority here, but even with the Release exe, you will still need any dependancies copied over as well.

    I suffered greatly with a similar problem (some months ago), and with the help of the forum members I finally managed to get it sorted. In my case, it turned out to be a hard coded path in one of the dll's I was using and a single config line was the answer. I would *never* have managed to trace the problem myself.

    To give another example - I have a Scheduler project. The project uses some data files (no DLL's in this case). I can - and do - copy the Data Folder and the exe file from the Debug folder to another machine and it just works. No installation or anything.


    Regards from Livingston, Scotland (Please ignore any stupid formatting produced by this forum)
    Monday, August 09, 2010 8:07 PM
  • Thank you for this advice!

     

    C

    Tuesday, August 10, 2010 11:52 AM
  • Ok, thank you Bjoern. This is very helpful.

    C

    Tuesday, August 10, 2010 11:53 AM
  • Hello,

    If you want release version of your exe, you should change from the compile tab configuration. You need change in the IDE, like the link what I showed below.

    https://adpyua.blu.livefilestore.com/y1paUi3dViyq9tKpEBAeeK6JTn2K1fdDyKeZnsQQccRKYzL7nltzf_EAYuzxJ_G9ENAL7FWdUS5JP9sxcHyOj2y3aHvDpkNRqc1/Release.jpg?psid=1

    To run your application in computer, you must have the computer with .net framework installed, and its dependents should also be deployed.

    Thanks

    Chao


    Please unmark it if it does not help, and mark it if it helps.
    Tuesday, August 10, 2010 12:02 PM