问题描述
我有一个部署到两个不同位置的 Windows 窗体应用程序.
I have a windows forms application that is deployed to two different locations.
- 内联网 - ClickOnce
- Internet - 通过 Windows 安装程序安装在 citrix 场上
我为单击一次部署版本显示 ClickOnce 版本号ApplicationDeployment.IsNetworkDeployed
.
I display ClickOnce version number for click-once deployed versionApplicationDeployment.IsNetworkDeployed
.
if (ApplicationDeployment.IsNetworkDeployed)
return ApplicationDeployment.CurrentDeployment.CurrentVersion;
但是对于非点击应用程序,除非我在程序集信息中硬编码版本号,否则我不确定如何检索 clickonce 版本.
But for the non-click application, I am not sure how to retrieve clickonce version unless I hardcode the version number in assembly info.
是否有自动检索非 clickonce 部署版本的 ClickOnce 版本号的方法?
Is there an automatic way of retrieve ClickOnce version number for non-clickonce deployed version?
推荐答案
不,我不相信有办法.我相信 ClickOnce 信息来自仅在 ClickOnce 部署中可用的清单.我认为硬编码版本号是你最好的选择.
No I do not believe that there is a way. I believe the ClickOnce information comes from the manifest which will only be available in a ClickOnce deployment. I think that hard coding the version number is your best option.
这篇关于如何在 Windows 窗体上显示 ClickOnce 版本号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!