我可以从应用程序内部获取 ClickOnce 发布的产品名称吗?
我的 ClickOnce 发布名称与程序集名称不同。出于讨论目的,它是“App 6.0”。我在项目的属性中设置了它。有什么办法可以从程序内部获取这个值吗?
I have a ClickOnce Publish Name that is different from the assembly name. For discussion purposes, it is "App 6.0". I set it in the Properties for my project. Is there any way to get this value from inside the program?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
添加对
Microsoft.Build.Tasks.v4.0.dll
的引用,然后运行以下命令:DeployManifest 还可以提供清单中的其他有用信息,例如 Publisher 或 SupportUrl。
Add a reference to
Microsoft.Build.Tasks.v4.0.dll
, then run this:The DeployManifest can also provide other useful info from your manifest, like Publisher or SupportUrl.
答案可以在ClickOnce Run at Startup<中找到/a>。本质上,您使用 InPlaceHostingManager 获取 ClickOnce 清单并读取它。它是一个异步方法,这让我感到烦恼,但这是迄今为止唯一有效的方法。非常感谢简化。请参阅网页以获取 DeploymentDescription 的说明。
The answer can be found in ClickOnce Run at Startup. Essentially, you use InPlaceHostingManager to get the ClickOnce manifest and read it. It bugs me that it is an asynchronous method, but this is the only thing that has worked thus far. Simplifications are much appreciated. See the webpage for a description of DeploymentDescription.
ApplicationDeployment.UpdatedApplicationFullName 属性
ApplicationDeployment.UpdatedApplicationFullName Property