Modify the project file as such:
<PropertyGroup> <CopyAllFilesToSingleFolderForPackageDependsOn> CustomConfigFiles; $(CopyAllFilesToSingleFolderForPackageDependsOn); </CopyAllFilesToSingleFolderForPackageDependsOn> <CopyAllFilesToSingleFolderForMsdeployDependsOn> CustomConfigFiles; $(CopyAllFilesToSingleFolderForPackageDependsOn); </CopyAllFilesToSingleFolderForMsdeployDependsOn> </PropertyGroup> <Target Name="CustomConfigFiles"> <ItemGroup> <YourCustomConfigFiles Include="..\Path\To\Your\**\*.config" /> <FilesForPackagingFromProject Include="%(YourCustomConfigFiles)"> <DestinationRelativePath>Target\Path\For\Your\%(RecursiveDir)%(Filename)%(Extension)</DestinationRelativePath> </FilesForPackagingFromProject> </ItemGroup> </Target>
based on this answer
source share