Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Batch compile of VB.Net projects

Status
Not open for further replies.

frankliu

Programmer
Nov 29, 2002
3
HK
Could someone please kindly show me the command line syntax of compiling a VB.Net project or solution?

What I would like to do is to set up a DOS batch file to mass compile a long list of VB.Net projects.

Thanks.
 
Thanks for the link provided. However, it mentions only compiling of individual VB source file and doesn't mention anything about compiling the whole project. Is that possible to do batch compile for projects just like what we used to do with VB6?

Please help!
 
Are you using Visual Studio? What files are you trying to compile. The *.vb files are what get compiled into the dll, so the vbc can compile these for you. You don't use the vbc to compile at a project level. After compiling your vb files, the dll needs to be in the bin directory.

I'm not sure how to do what you are asking, if it can even be done, but I think that you mean what I said above.

regards,
Brian
The problem with doing something right the first time is that nobody appreciates how difficult it was.
 
Open a Visual Studio command prompt (so the enviromental variables are set, allowing you command-line access to the .NET tools), and type:
Code:
devenv /?
You'll get a list of command-line parameters that the development environment understands:
[tt]
C:\Documents and Settings\chiph\Desktop>devenv /?

Microsoft (R) Development Environment Version 7.10.3077.
Copyright (C) Microsoft Corp 1984-2001. All rights reserved.

Usage:
devenv [solutionfile | projectfile | anyfile.ext] [switches]

You can invoke devenv with a first argument to specify a solution file or
project file. You can also invoke devenv with a first argument that is any
other kind of file that you just want to open in an editor. When you supply a
project file, the IDE opens it in the context of a solution by looking for a
.sln file with the same base name as the project file in the same
directory as the project file. If no such .sln file exists, then the IDE
looks for a single .sln file that references the project. If no such single
.sln file exists, then the IDE creates an unsaved solution with a default .sln
file name that has the same base name as the project file.

Command line builds:
devenv solutionfile.sln /build solutionconfig [ /project projectnameorfile [ /projectconfig name ] ]

Available command line switches:

/build build the specified solution configuration
/project specifies the project to build instead of solution
must specify /build to use /project
/projectconfig specifies project configuration to build
must specify /project to use /projectconfig
/out write build output to specified file
/rebuild like /build but forces a clean first
/clean clean up build outputs
/deploy build the specified solution configuration and then deploy it
/run run the specified solution configuration
/runexit run the specified solution configuration and then terminate
/command executes the specified internal command line after startup
/mditabs use tabbed documents interface
/mdi use MDI interface
/fn use specified font name
/fs use specified font size
/LCID use specified language ID
/noVSIP disables VSIP developers license key for VSIP testing
/safemode only default environment and services load for stability
/resetskippkgs allow VsPackages once flagged for loading failures to
load again
/migratesettings migrate some user settings from another version

Product-specific switches:

/debugexe Open the specified executable to be debugged. The
remainder of the command line is passed to this
executable as its arguments.
/useenv Use PATH, INCLUDE, LIBPATH, and LIB environment variables
instead of IDE paths for VC++ builds.

To attach the debugger from the command line, use:
vs7jit.exe -p <pid>

C:\Documents and Settings\chiph\Desktop>
[/tt]

Chip H.


If you want to get the best response to a question, please check out FAQ222-2244 first
 
Thanks Chip.

I think what you provided are pretty much close to what I need. However when I tried the following command syntax (after I set path to devenv.com and chdir to where my solution and project files are):

devenv test.sln /build

then I got the error:

Invalid solution configuration

and when I tried with:

devenv test.vbproj /build /project

then I got the error:

Missing switch argument. Configuration name required for /build switch

Did I miss anything? What exactly is the configuration name it talked about? I just want to build (compile) the solution file or the project file into an EXE in this case.

Could you or someone please provide me with the full and correct command syntax and an example of doing that?

Many thanks.

 
You need to do something like this:

devenv test.sln /build Debug

Where &quot;Debug&quot; is one of your configuration choices (Debug, Release, etc).

Chip H.


If you want to get the best response to a question, please check out FAQ222-2244 first
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top