Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Method for Application Version on a Console Utility App

Tags:

c#

.net

console

People also ask

What are the examples of console application?

Console-based applications include Alpine (an e-mail client), cmus (an audio player), Irssi (an IRC client), Lynx (a web browser), Midnight Commander (a file manager), Music on Console (an audio player), Mutt (an e-mail client), nano (a text editor), ne (a text editor), newsbeuter (an RSS reader), and ranger (a file ...

How do you make a console application?

Open Visual Studio, and choose Create a new project in the Start window. In the Create a new project window, select All languages, and then choose C# from the dropdown list. Choose Windows from the All platforms list, and choose Console from the All project types list.

What is console application and Windows application?

A Windows form application is an application that has a graphical user interface(GUI) like the Visual C# IDE. A console program on the other hand is a text application. There are not fancy controls like buttons or textboxes in a console application and they are run from the command prompt.


Assembly.GetExecutingAssembly().GetName().Version

Also, you can still use the class, you just have to reference the containing assembly. It's no biggie.


Assembly.GetExecutingAssembly().GetName().Version is not the same as Application.ProductVersion (but may be good enough depending on your environment.

As can be seen with Lutz Reflector, Application.ProductVersion first attempts to use the AssemblyInformationalVersion attribute from Assembly.GetEntryAssembly() if it's present, and if GetEntryAssembly() is not null.

Otherwise it uses the file version of the executable file.

I don't see any reason not to use Application.ProductVersion in a console application.