Compiling a .vbproj or .csproj project file without Visual Studio

0 votes
asked Nov 5, 2008 by daniel-magliola

Is there a way to compile a .vbproj or .csproj project file directly, just like Visual Studio does?

When you compile in Visual Studio, the "output" window shows the actual call to the compiler, which normally looks like:

vbc.exe [bunch of options] [looooong list of .vb files]

I would like to programatically call "something" that would take the .vbproj file and do whatever Visual Studio does to generate this long command line. I know i could parse the .vbproj myself and generate that command line, but I'd rather save myself all the reverse engineering and trial-and-error...

Is there a tool to do this? I'd rather be able to do it in a machine without having Visual Studio installed. However, if there's a way to call Visual Studio with some parameters to do it, then that'll be fine too.

I looked briefly at MSBuild, and it looks like it works from a .proj project file that i'd have to make especially, and that I'd need to update every time I add a file to the .vbproj file. (I did look briefly at it, so it's very likely I missed something important)

Any help will be greatly appreciated

5 Answers

0 votes
answered Nov 5, 2008 by rob-prouse

MSBuild can also take your solution file and use it to do the compile.

0 votes
answered Nov 5, 2008 by aarons

You can use either MSBUILD or CSC. MSBuild, which as you mentioned, does use your project and solution files. CSC will compile specific files, or all files in a specific directory tree.

You should also look at automating your builds with NAnt and/or

Also, here is an example on how to compile your code without visual studio using CSC.

0 votes
answered Nov 22, 2009 by sayed-ibrahim-hashim

Just so you know .vbproj and .csproj files are MSBuild. So everything that you've read, you can apply to those files directly.

Sayed Ibrahim Hashimi

My Book: Inside the Microsoft Build Engine : Using MSBuild and Team Foundation Build

0 votes
answered Nov 16, 2013 by jwplatt

At the top of a .vbproj file is a . Add this line to the property group to suppress the VB runtime:


MSBuild does the rest. No need to use the command line if you have the IDE.

0 votes
answered Sep 15, 2017 by alexander-ivanov

In project solution folder:

msbuild wpfapp1.sln /p:BuildProjectReferences=true

MSbuild is usually located in:


(or something similar, depending on the version)

csc.exe compiles files, msbuild compiles projects and solutions

Welcome to Q&A, where you can ask questions and receive answers from other members of the community.
Website Online Counter