I am trying to create an automatic assembly for my web application project. We use the standard CMS project and changed some parts of it. Only modified files are part of our project, but I want to include a complete CMS in the deployment package.
So, I created my own .targets file to define the task for including CMS files during build:
<Target Name="GetCMSFiles"> <ItemGroup> <_CMSFiles Include="..\packages\CMSFiles\**\*" /> <FilesForPackagingFromProject Include="%(_CMSFiles.Identity)"> <DestinationRelativePath> %(RecursiveDir)%(Filename)%(Extension) </DestinationRelativePath> </FilesForPackagingFromProject> </ItemGroup> </Target> <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'"> <CopyAllFilesToSingleFolderForPackageDependsOn> GetCMSFiles; $(CopyAllFilesToSingleFolderForPackageDependsOn); </CopyAllFilesToSingleFolderForPackageDependsOn> <CopyAllFilesToSingleFolderForMsdeployDependsOn> GetCMSFiles; $(CopyAllFilesToSingleFolderForMsdeployDependsOn); </CopyAllFilesToSingleFolderForMsdeployDependsOn> </PropertyGroup>
This works fine, but the problem is that the files from our project are not copied to the deployment folder. In other words, it does not overwrite files that already exist after I copied them with the GetCMSFiles task.
As I see, there are two options:
But I'm not sure that this is possible and how to achieve this. Any ideas?
source share