我有以下 *.wpp.target 文件:
<PropertyGroup>
<CopyAllFilesToSingleFolderForMsdeployDependsOn>
ExcludeCustomFilesOrFolders;
$(CopyAllFilesToSingleFolderForPackageDependsOn);
</CopyAllFilesToSingleFolderForMsdeployDependsOn>
</PropertyGroup>
<Target Name="ExcludeCustomFilesOrFolders" BeforeTargets="ExcludeFilesFromPackage">
<ItemGroup>
<ExcludeFromPackageFolders Include="$(MSBuildProjectDirectory)\Media" />
</ItemGroup>
<Message Text="Custom Exclude From %0D Folders: @(ExcludeFromPackageFolders)%0D Files: @(ExcludeFromPackageFiles)" Importance="high"/>
</Target>
如果我第一次从 Visual Studio 17 中运行它,Media 文件夹将被忽略且未发布。当我用 ExcludeFromPackageFolders 节点评论该行并再次发布后,媒体文件夹仍然被忽略。似乎 Visual Studio 或 msbuild 不会刷新 *.wpp.target 文件中所做的更改。我在这里想念什么还是 VS 或 MSbuild 有问题?