vb.net – When using visual basic and .NET 6, is there a way to access PublishVersion in my code?


PublishVersion is automatically incremented by Visual studio so is a logical variable to use to include version info in the app. A solution was published some years ago for .NET 4.8.1 (vb.net how to programatically read project > props > Publish > Publish Version > Revision) using System.Deployment.Application.ApplicationDeployment, but .NET 6 doesn’t appear to include System.Deployment.

It is annoying to keep manually changing AssemblyVersion when Visual Studio has the autoincrement feature built in.

Is there a solution when using .NET 6?

I have searched using object browser and the net and found nothing except the 2017 post that uses .NET 4.8.1. I’m not comfortable with deliberately developing an app that depends on outdated software.

Leave a Reply

Your email address will not be published. Required fields are marked *