.net-coreclickonce

How can I get the full publish version of a .NET (not framework) ClickOnce assembly at runtime in C#


I can't seem to find a way to grab the ClickOnce publish version of a .NET (not Framework) WPF app. I can get the the publish version from the assembly but that's a hard coded value that gets set in the project's .csproj.

I need the auto-incremented publish version from the ClickOnce at runtime in C#.

In .NET Framework I could do the following:

            ApplicationDeployment AD = ApplicationDeployment.CurrentDeployment;
            PublishVersion = AD.CurrentVersion.ToString();

I can't find anything analagous in .NET


Solution

  • Looks like it doesn't exist in .net core or .NET 5(though it might get ported), but this might offer what you need -> https://github.com/derskythe/WpfSettings