Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
MSBuild project definition to execute arbitrary code from msbuild.exe
<Project ToolsVersion="4.0" xmlns="">
<!-- This inline task executes c# code. -->
<!-- C:\Windows\Microsoft.NET\Framework64\v4.0.30319\msbuild.exe msbuild.xml -->
<Target Name="Hello">
<SharpLauncher >
AssemblyFile="C:\Windows\Microsoft.Net\Framework\v4.0.30319\Microsoft.Build.Tasks.v4.0.dll" >
<Using Namespace="System" />
<Using Namespace="System.Net" />
<Using Namespace="System.Reflection" />
<Code Type="Fragment" Language="cs">
Console.WriteLine(" EVIL CODE HERE ! :-) ");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment