Philippsen's Blog

Everyday findings in my world of .net and related stuff

Archive for the ‘Tools’ Category

Manually compile C# project using command line

Posted by Torben M. Philippsen on June 20, 2011

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 vb.net 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.

Posted in Tools, Visual Studio | Tagged: , , , | Comments Off on Manually compile C# project using command line

Copy source as Html in Visual Studio 2010

Posted by Torben M. Philippsen on October 25, 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”.

Posted in Tools | Comments Off on Copy source as Html in Visual Studio 2010

 
%d bloggers like this: