Skip to content

Instantly share code, notes, and snippets.

@commel
Created August 15, 2018 08:43
Show Gist options
  • Save commel/d117b5973ae3014ce7de61501a8789a7 to your computer and use it in GitHub Desktop.
Save commel/d117b5973ae3014ce7de61501a8789a7 to your computer and use it in GitHub Desktop.
msbuild example
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<AssemblyName>DtExample</AssemblyName>
</PropertyGroup>
<ItemGroup>
<Compile Include="Main.cs" />
</ItemGroup>
<Target Name="Build">
<Message Text="Hello World! A"/>
<MakeDir Directories="$(OutputPath)" Condition="!Exists('$(OutputPath)')" />
<Csc Sources="@(Compile)" References="TextLib.dll" OutputAssembly="$(OutputPath)$(AssemblyName).exe" />
</Target>
<Target Name="Clean">
<Delete Files="$(OutputPath)$(AssemblyName).exe" />
</Target>
</Project>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<AssemblyName>TextLib</AssemblyName>
</PropertyGroup>
<ItemGroup>
<Compile Include="TextLib.cs" />
</ItemGroup>
<Target Name="Build">
<MakeDir Directories="$(OutputPath)" Condition="!Exists('$(OutputPath)')" />
<Csc Sources="@(Compile)" TargetType="library" OutputAssembly="$(OutputPath)$(AssemblyName).dll" />
</Target>
<Target Name="Clean">
<Delete Files="$(OutputPath)$(AssemblyName).dll" />
</Target>
</Project>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment