visual-studio 如何禁用 ClickOnce(或至少是 Visual Studio 2010 Express 中的“您确定要安装此程序吗”窗口)
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/3901267/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to disable ClickOnce (or at least that "Are you sure you want to install this program" window in Visual Studio 2010 Express
提问by user419076
How might I go about creating an application that does not need that "Publisher Cannot be verified" window?
我如何着手创建不需要“无法验证发布者”窗口的应用程序?
How can I get my Windows Formsapplication in a EXE file so that I can just click it and it runs, not asking me to do anything? Maybe this can be done by disabling ClickOnce, but how can you do that in Visual Studio 2010 Express?
如何在 EXE 文件中获取我的Windows 窗体应用程序,以便我只需单击它并运行它,而不要求我执行任何操作?也许这可以通过禁用 ClickOnce 来完成,但是如何在Visual Studio 2010 Express 中做到这一点?
回答by Kian
I think the reason that no one understood your question is that the only time ClickOnce is used for deployment is when you use the "Publish" wizard.
我认为没有人理解您的问题的原因是 ClickOnce 用于部署的唯一时间是在您使用“发布”向导时。
What you're looking to do is: Go to the Build menu -> Configuration Manager -> and change the "Active solution configuration" to release. This will make Visual Studio optimise your code. Then F6(Build Solution) and your basic exectutable (.exe) files will be in your {projectDirectory}/bin/Release folder, and you'll be able to run this from any computer that has the .NET framework you compiled in.
您要做的是:转到构建菜单 -> 配置管理器 -> 并将“活动解决方案配置”更改为发布。这将使 Visual Studio 优化您的代码。然后F6(Build Solution) 和您的基本可执行 (.exe) 文件将位于您的{projectDirectory}/bin/Release 文件夹中,您将能够从任何具有您编译的 .NET 框架的计算机上运行它。
回答by Rory MacLeod
Using ClickOnce involves opening a link in a browser that ends in ".application", but it sounds like you're just launching a normal EXE from your local machine, so I don't think ClickOnce is involved.
使用 ClickOnce 需要在浏览器中打开一个以“.application”结尾的链接,但听起来您只是从本地机器启动一个普通的 EXE,所以我认为不涉及 ClickOnce。
Did you copy the file to your machine across a network? Right-click on the EXE, open Properties, and see if there's an "Unblock" button at the bottom of the window. If so, click it.
您是否通过网络将文件复制到您的机器上?右键单击 EXE,打开“属性”,然后查看窗口底部是否有“取消阻止”按钮。如果是,请单击它。
The "publisher cannot be verified" message relates to code signing. Like I said above, you should be able to tell Windows not to be so strict with that file, but if you really need to get signed, you could start with MSDN's Introduction to Code Signing.
“无法验证发布者”消息与代码签名有关。就像我上面说的,你应该能够告诉 Windows 不要对那个文件那么严格,但是如果你真的需要签名,你可以从 MSDN 的代码签名简介开始。
回答by Adrian
The message occurs because the certificate used to sign the ClickOnce XML site can not be verified. These MSDN articles describes the problem:
出现该消息是因为无法验证用于签署 ClickOnce XML 站点的证书。这些 MSDN 文章描述了这个问题:
回答by RobinDotNet
Are you using ClickOnce deployment? You can not get rid of the "Unknown publisher" window unless you have a valid certificate with a trusted publisher, and you install it on the user's machine.
您是否使用 ClickOnce 部署?您无法摆脱“未知发布者”窗口,除非您拥有受信任发布者的有效证书,并且将其安装在用户的计算机上。

