我很难以新的 .net core 3.1 csproj 格式设置 PublishDir 值。在旧的 csproj 格式中,我可以这样设置值:
<PropertyGroup>
<PublishDir>..\test\path</PublishDir>
我什至可以在 PublishDir 元素中使用 Condition 属性来根据构建配置使用不同的值。
现在使用新的 csproj 我尝试了相同的方法,但 PublishDir 仍然设置为:
bin/Release/netcoreapp3.1/win-x64/app.publish
. 这个目录来自哪里?
只有当我使用 /p:PublishDir="..\test\path" 通过 msbuild 调用添加参数时,应用程序才会在适当的目录中发布。
还有什么我需要考虑的吗?我是否需要在特定目标之后设置值,例如 PrepareForPublish?