我有一个代码可以在部署时复制propper配置文件:
<PropertyGroup>
<CopyAllFilesToSingleFolderForPackageDependsOn>
CopyConfigFiles;
$(CopyAllFilesToSingleFolderForPackageDependsOn);
</CopyAllFilesToSingleFolderForPackageDependsOn>
</PropertyGroup>
<Target Name="CopyConfigFiles">
<ItemGroup>
<_ConfigFiles Include="Configurations\*.$(Platform).config" />
<FilesForPackagingFromProject Include="%(_ConfigFiles.Identity)">
<DestinationRelativePath>%(Filename)%(Extension)</DestinationRelativePath>
</FilesForPackagingFromProject>
</ItemGroup>
</Target>
是否可以从结果文件中删除 $(Platform) ?
IE。
- $(平台)= 生产
- 来源:connectionString.Production.config
- 目的地:connectionString.config