Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Exclude files from being build in Debug

Tags:

c#

.net

msbuild

My WP7 solution has a Class Library which contains three big embedded resources. When the XAP file is generated, it takes quite a while to compress those three files and I would like to speed up the time required to build when I am in Debug mode (but not Release).

How do I specify in the CSProj that I don't want the file 2 and 3 to be build if I am building Debug?

  <ItemGroup>
    <EmbeddedResource Include="Data\my-big-file-1.txt" />
    <EmbeddedResource Include="Data\my-big-file-2.txt" />
    <EmbeddedResource Include="Data\my-big-file-3.txt" />    
  </ItemGroup>

Thanks!

like image 862
Martin Avatar asked Jun 11 '12 12:06

Martin


1 Answers

You can use conditions in your Project Definition file.

http://msdn.microsoft.com/en-us/library/ms171455.aspx

<EmbeddedResource Include="Data\my-big-file-2.txt"  Condition=" '$(Configuration)' == 'Release' "/>
like image 80
Raphaël Althaus Avatar answered Oct 04 '22 16:10

Raphaël Althaus