如何控制 ClickOnce 应用程序的输出生成位置(使用 Microsoft.Build.BuildEngine)?

发布于 2024-08-07 07:44:39 字数 851 浏览 6 评论 0原文

我有一个 ClickOnce WPF 应用程序,我正在使用 Microsoft.Build.BuildEngine 来构建。一切似乎都工作正常,但是当进行有针对性的构建来发布应用程序时,它将发布的输出放入 .\bin\Release\app.publish

尽管设置了属性“PublishURL”、“OutDir”、“WebProjectOutputDir” - 我可以设置另一个属性来完成此任务吗?

有没有办法控制 app.publish 目录的创建位置?

projectToBuild.SetProperty("OutDir", workingDirectory);
projectToBuild.SetProperty("WebProjectOutputDir", workingDirectory);
projectToBuild.SetProperty("PublishURL", workingDirectory);
projectToBuild.Build("publish");

看起来它总是发布到“OutputPath”\app.publish 我尝试了以下操作:

var myOutputPath1 = projectToBuild.GetEvaluatedProperty("OutputPath");
projectToBuild.SetProperty("OutputPath", workingDirectory);
var myOutputPath2 = projectToBuild.GetEvaluatedProperty("OutputPath");

不幸的是 myOutputPath1 和 myOutputPath2 是相同的,似乎“OutputPath”没有被更新。

I have a ClickOnce WPF application that I am using Microsoft.Build.BuildEngine to build. Everything appears to be working correctly, but when doing a targeted build to publish the application it is putting the published output to .\bin\Release\app.publish

This is despite setting the properties "PublishURL", "OutDir", "WebProjectOutputDir" - is there another property that I can set to accomplish this?

Is there a way to control where the app.publish directory is created?

projectToBuild.SetProperty("OutDir", workingDirectory);
projectToBuild.SetProperty("WebProjectOutputDir", workingDirectory);
projectToBuild.SetProperty("PublishURL", workingDirectory);
projectToBuild.Build("publish");

It looks like it always publishes to "OutputPath"\app.publish I've tried the following:

var myOutputPath1 = projectToBuild.GetEvaluatedProperty("OutputPath");
projectToBuild.SetProperty("OutputPath", workingDirectory);
var myOutputPath2 = projectToBuild.GetEvaluatedProperty("OutputPath");

Unfortunately myOutputPath1 and myOutputPath2 are the same, it appears the "OutputPath" is not being updated.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文