EEVblog Electronics Community Forum
A Free & Open Forum For Electronics Enthusiasts & Professionals
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email
?
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
This topic
This board
Entire forum
Google
Bing
Home
Help
Search
About us
Links
Login
Register
EEVblog Electronics Community Forum
»
Electronics
»
Microcontrollers
»
VS2022 ClickOnce version
« previous
next »
Print
Search
Pages: [
1
]
Go Down
Author
Topic: VS2022 ClickOnce version (Read 1300 times)
0 Members and 1 Guest are viewing this topic.
ArCoN
Contributor
Posts: 24
Country:
VS2022 ClickOnce version
«
on:
November 06, 2023, 07:08:19 am »
Hi All
Anyone knows how to get the version from the clickonce into the app somehow?
I have this now, and it does not work. dont know where it gets that version from
this.Text += " " + Assembly.GetEntryAssembly().GetName().Version;
B.R.
Logged
cgroen
Supporter
Posts: 631
Country:
Re: VS2022 ClickOnce version
«
Reply #1 on:
November 06, 2023, 12:16:48 pm »
This works for me:
private string getVersion() {
Assembly assembly = Assembly.GetExecutingAssembly();
FileVersionInfo fileVersionInfo = FileVersionInfo.GetVersionInfo(assembly.Location);
return fileVersionInfo.ProductVersion;
}
Logged
ArCoN
Contributor
Posts: 24
Country:
Re: VS2022 ClickOnce version
«
Reply #2 on:
November 06, 2023, 12:27:49 pm »
Thanks for the input. but it still returns 1.0.0
Logged
cgroen
Supporter
Posts: 631
Country:
Re: VS2022 ClickOnce version
«
Reply #3 on:
November 06, 2023, 01:26:14 pm »
Strange, works in several applications here.
Good luck fixing this, sometimes its not clear what's going on behind the curtains...
Logged
ArCoN
Contributor
Posts: 24
Country:
Re: VS2022 ClickOnce version
«
Reply #4 on:
February 02, 2024, 11:58:50 am »
This is working, when it is published
string versionString = Environment.GetEnvironmentVariable("ClickOnce_CurrentVersion") ?? "0.0.0.0";
Version version = Version.Parse(versionString);
return version;
Logged
Print
Search
Pages: [
1
]
Go Up
« previous
next »
Share me
Smf
EEVblog Electronics Community Forum
»
Electronics
»
Microcontrollers
»
VS2022 ClickOnce version
There was an error while thanking
Thanking...
EEVblog Main Site
EEVblog on Youtube
EEVblog on Twitter
EEVblog on Facebook
EEVblog on Odysee