How to display ClickOnce Version number on Windows Forms

Add an assembly reference to System.Deployment to your project. Import the namespace in your class file: VB.NET: Imports System.Deployment.Application C#: using System.Deployment.Application; Retrieve the ClickOnce version from the CurrentVersion property. You can obtain the current version from the ApplicationDeployment.CurrentDeployment.CurrentVersion property. This returns a System.Version object. Note (from MSDN): CurrentVersion will differ from UpdatedVersion if a … Read more

ClickOnce and IsolatedStorage

You need to use application scoped, rather than domain scoped, isolated storage. This can be done by using one of IsolatedStorageFileStream’s overloaded constructors. Example: using System.IO; using System.IO.IsolatedStorage; … IsolatedStorageFile appScope = IsolatedStorageFile.GetUserStoreForApplication(); using(IsolatedStorageFileStream fs = new IsolatedStorageFileStream(“data.dat”, FileMode.OpenOrCreate, appScope)) { … However, now you will run into the issue of this code only working … Read more

Error message “Unable to install or run the application. The application requires stdole Version 7.0.3300.0 in the GAC”

Try going to the Publish tab in the project properties and then select the Application Files button. Then set the following properties: File Name of stdole.dll Publish status to Include Download Group to Required After that you need to republish your application. If the reference has CopyLocal=true, then the reference will be published with the … Read more

WPF ClickOnce DPI awareness Per-Monitor v2

First of all, anyone who want’s to cry out – simply target .NET 4.6.2, per monitor DPI awareness is enabled by default – that is simply not true. What is enabled by default in .NET 4.6.2 is the boilerplate code behind the scenes – quite nasty c++ hooks in window declaration code to enable support … Read more