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

Developer technologies .NET .NET Runtime
Developer technologies .NET .NET CLI
Developer technologies C#
{count} votes

2 answers

Sort by: Most helpful
  1. Bruce (SqlWork.com) 77,686 Reputation points Volunteer Moderator
    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

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.