A customer asked me the other day about excluding different files (or directories) based on the type of build happening.  Specifically they wanted to exclude some files for Release builds and others for Debug builds.

 

Here is the general info on how to exclude files from builds:

http://msdn.microsoft.com/en-us/library/ms171455(v=VS.110)

 

Within the article you will want to take a look at the Condition attribute which specifically calls out how to exclude based on build type:

<Compile
    Include="Formula.vb"
    Condition=" '$(Configuration)' == 'Release' " />