It sounds like it should be pretty simple, but I am having problems with excluding folders when using the MSBUILD copy task. That's what I'm doing:
<ItemGroup>
<Compile Include="$(_SolutionPath)$(_SolutionName)" />
<ProjectFiles Include="..\$(_WebDirectory)\*.csproj" Exclude="*.master.csproj"/>
<ExcludeFromBuild Include="..\$(_WebDirectory)\**\*.cs; ..\$(_WebDirectory)\**\*.sln; ..\$(_WebDirectory)\**\*.csproj; ..\$(_WebDirectory)\Web References; ..\$(_WebDirectory)\obj;"/>
<AppFolder Include="..\$(_WebDirectory)\**\*.*" Exclude="$(ExcludeFromBuild)"/>
</ItemGroup>
<Copy SourceFiles="@(AppFolder)" DestinationFiles="c:\test\%(RecursiveDir)%(FileName)%(Extension)"/>
The element group section has an ExcludeFromBuild element, which lists the types of files that I want to exclude. In addition, I want to exclude the "obj" and "Web References" folders.
How can i do this? Please let me know if more information is needed. Thank.
Shahzad
source
share