ClickOnce 禁止发布调试版本

发布于 2024-08-25 07:00:14 字数 462 浏览 5 评论 0原文

使用 Visual Studio 2008 发布 ClickOnce 应用程序时是否有禁止发布调试版本的方法?

我知道以前有人问过这个问题,但我无法从答案中找出答案。上一个问题的接受答案是:

您可以做的一件事就是添加 .csproj 或 .vbproj 的条件 MSBuild 将在以下情况下检查的文件 进行构建。

条件将检查是否发布 正在发生并检查构建是否正在 调试构建,然后执行类似的操作 运行外部工具或以其他方式 中断构建过程或导致 它会失败。

谁能详细说明这个答案,或者告诉我在哪里/或如何添加这个条件。

原始问题链接

Is there anyway to disallow publishing Debug builds when publishing ClickOnce aplications using Visual Studio 2008?

I know this was asked before, but i can't figure out how from the answer. THe Accepted answer for previous question was:

One thing you can do is add a
condition to the .csproj or .vbproj
file that MSBuild will check when
doing a build.

The condition would check if a publish
is occurring and check if the build is
a debug build, then do something like
run an external tool or otherwise
interrupt the build process or cause
it to fail.

Could anyone elaborate on that answer or tell me where/or how I can add this condition.

Link to Original Question

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

城歌 2024-09-01 07:00:14

在 Visual Studio(我使用的是 2008)中,工具 -> 选项 -> 项目和解决方案 -> 常规。然后取消选中“显示高级构建配置”选项(屏幕上的第三个复选框)。这应该能让你得到你想要的。也就是说,调试和零售之间的选项将消失,当您从 VS 中单击 F5(等)时,您将调试以调试模式构建的项目,但是当您通过 ClickOnce 部署(或构建安装包等)时,您将调试以调试模式构建的项目。 )它将使用零售模式。

注意事项:我自己还没有这样做,但我(在 PDC)向 Microsoft 询问了这个问题,这就是我得到的答案。此外,如果您定义了任何其他模式(这是我一直在处理的项目的情况,这就是它尚未工作的原因),调试/零售构建选项仍然会出现(并且不会像上面那样工作)为我)。

In Visual Studio (I'm using 2008), Tools->Options->Projects and Solutions->General. Then UNCHECK the option that says "Show advanced build configurations" (the 3rd check box on my screen). That should get you what you want. That is, the option between Debug and Retail will go away, and when you click F5 (etc.) from VS you will be debugging a project built in Debug mode, but when you Deploy via ClickOnce (or build an install package, etc.) it will use Retail mode.

Caveats: I haven't done this yet myself, but I asked Microsoft this question (at the PDC), and this was the answer I was given. Also, the Debug/Retail build options will STILL appear (and it won't work as above) if you have defined any additional modes (which is the case for the project I've been working on, which is why it's not yet working for me).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文