How to find daemon application version using .Net Core 3.1 with systemd?

Prabs 1 Reputation point
2021-08-05T11:41:25.693+00:00

Hello Team,

I have a C# .NET Core 3.1 daemon application which is running in RedHat Linux. Application output type is console application

How to find version of the application when i run the following command
testApp.service -v

Could you please help me on this?

Example:
if we run rsyslog -v command, the rsyslog version details will be shown in terminal window.
Same way, my application version details has to shown in terminal window.

Regards,
Prabs

.NET CLI
.NET CLI
A cross-platform toolchain for developing, building, running, and publishing .NET applications.
322 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,247 questions
.NET Runtime
.NET Runtime
.NET: Microsoft Technologies based on the .NET software framework.Runtime: An environment required to run apps that aren't compiled to machine language.
1,119 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Bruce (SqlWork.com) 56,021 Reputation points
    2021-08-06T15:22:20.883+00:00

    You need to write code to implement this standard practice. The command line arguments will be passed to your main() in program.cs. You write code to check for the -v switch and display the version information rather than executing the standard code path. If you configure assembly info in your project you can use

    https://learn.microsoft.com/en-us/dotnet/api/microsoft.visualbasic.applicationservices.assemblyinfo?view=net-5.0

    To get the info to display.

    0 comments No comments

  2. Prabs 1 Reputation point
    2021-08-10T10:27:29.237+00:00

    Thanks Bruce.

    0 comments No comments