Category Archives: Tools

Manually compile C# project using command line

For various reasons I sometimes have to build projects outside my Visual Studio environment. One approach is to use the sommand line tool csc.exe (for c# projects) or vbc.exe (for projects). It can be quite exhausting to build the command – especially if your are using external libraries, ressources, settings and other quite common stuff. It would be nice if one could just fetch the command that Visual Studio uses to compile the project – well you can:-)

If you want to have a look at the command that Visual studio uses to compile you project, all you need to do is to launch a command similar to this in a visual studio command prompt:

E:\VSS\Grene\AxXMLService\AxXMLService>msbuild AxXMLService.csproj /t:rebuild /clp:showcommandline >> log.txt

This command will produce a log file containing the output – this will look something like this:

csc command output

csc command output

Please note the highlighted section – here you will find the command you need to build your project outside visual studio. the only requirement is ofcouse that the relevant framework version is installed on the machine performing the build.

Copy source as Html in Visual Studio 2010

For some time I’ve been looking for a good way to copy my source code into this blog, without having to install a┬áplugin. I stumpled across this great article about how to enable “Copy source as html” in Visual Studio 2010. “Copy source as HTML” can be downloaded from codeplex – check it out.


Update: 2011-11-30

For some strange reasons “Copy Source as HTML” has stopped working and I am not able to get it up and running again. Instead of struggling any more than necessary I installed “Code4Blog“. It seems to work really great and even better than “Copy Source as HTML”.