Advertisement
Guest User

MSBUILD section for compiling CIL in Visual Studio

a guest
Nov 2nd, 2010
1,063
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 1.27 KB | None | 0 0
  1.   <Import Project="$(MSBuildToolsPath)\Microsoft.Common.targets" />
  2.  
  3.   <Target Name="CreateManifestResourceNames" />
  4.  
  5.   <Target Name="CoreCompile" Inputs="$(MSBuildAllProjects);@(Compile);" Outputs="@(IntermediateAssembly);$(NonExistentFile);">
  6.     <GetFrameworkPath>
  7.       <Output TaskParameter="Path" PropertyName="FrameworkPath" />
  8.     </GetFrameworkPath>
  9.    
  10.     <PropertyGroup>
  11.       <IlAsmCommand>&quot;$(FrameworkPath)\Ilasm.exe&quot; /NOLOGO /DLL /OUTPUT:&quot;@(IntermediateAssembly)&quot; </IlAsmCommand>
  12.     </PropertyGroup>
  13.  
  14.     <PropertyGroup Condition=" '$(Configuration)' == 'Debug' " >
  15.       <IlAsmCommand>$(IlAsmCommand) /DEBUG </IlAsmCommand>
  16.     </PropertyGroup>
  17.  
  18.     <PropertyGroup Condition=" '$(Configuration)' == 'Release' " ><IlAsmCommand>$(IlAsmCommand) /OPTIMIZE </IlAsmCommand></PropertyGroup>
  19.  
  20.     <PropertyGroup Condition=" '$(AssemblyOriginatorKeyFile)' != '' " >
  21.       <IlAsmCommand>$(IlAsmCommand) /KEY:&quot;$(AssemblyOriginatorKeyFile)&quot; </IlAsmCommand>
  22.     </PropertyGroup>
  23.  
  24.     <Exec Command="$(IlAsmCommand) @(Compile->'&quot;%(FullPath)&quot;', ' ')"
  25.           Outputs="@(IntermediateAssembly)" />
  26.    
  27.     <CallTarget Targets="$(TargetsTriggeredByCompilation)" Condition="'$(TargetsTriggeredByCompilation)' != ''" />
  28.  
  29.   </Target>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement