MrW
MrW

Reputation: 1210

MSBuild flattens the folder structure

I'm trying to copy my Views folder for my MVC project in an MSBuild task, but it keeps on flatten everything, and I've tried loads of different things, but never manage to get it to work. Do you have any idea?

<ItemGroup>
    <ViewsFolder Exclude="*.cs;*.svn-base;" Include="../MyMVCProject.Web\Views\**\*.*"/>    
</ItemGroup>

<Copy SourceFiles="@(ViewsFolder)" DestinationFolder="c:\MyProject\Destination\MyMVCProject.Web\Views" />

Upvotes: 2

Views: 733

Answers (1)

Preet Sangha
Preet Sangha

Reputation: 65556

see here using %(RecursiveDir)

<Copy SourceFiles="@(ViewsFolder)" DestinationFolder="c:\MyProject\Destination\MyMVCProject.Web\Views\%(recursiveDir)" />

Upvotes: 5

Related Questions