2

I can manually do this (without a single problem) to compile my VB.NET code into my stand-alone WindowsForms executable. But is there a way to do this all from a command-line script? I've checked into Vbc, MsBuild, and DevEnv but they all seem to be unable to do 1 (or more) of my needed steps.

  1. Double-click on my foo.vbproj and launch VS2005.
  2. Change a few of my #Const vars from true to false.
  3. Hit F5 to compile it.
  4. Change my #Const back to their original settings.
  5. Exit VS2005.
  6. Enjoy my newly created bin\debug\foo.exe

Any idea on how to do this from a command-line script instead? Thanks.

Bakchod Guru
  • 51
  • 1
  • 6
  • You probably want to use MSBuild or NAnt to do this. This topic may help: http://stackoverflow.com/questions/476163/nant-or-msbuild-which-one-to-choose-and-when – Derek Tomes May 06 '13 at 02:52
  • MSBuild documentation is here: http://msdn.microsoft.com/en-us/library/dd393574.aspx – Derek Tomes May 06 '13 at 02:53
  • I've re-re-re-re-read the documention on MSBuild... it seems unable to do something as simple as "change a couple of #const" and "hit F5" for me. (I'm not allowed to install NAnt or other tools on these machines. Can't the fortune we paid for all the VS version... do this simple thing?) – Bakchod Guru May 06 '13 at 03:30

1 Answers1

0

You could define the #consts at the project level, and have multiple project files: each identical but having different constants - foo1.vbproj, foo2.vbproj etc. These constants can be defined in project properties. Then use MSBuild to build each project.

Paul Anderson
  • 1,120
  • 3
  • 11
  • 22