Resolve .NET runtime version with same approach for .NET and .NET Framework

181 Views Asked by At

We're developing several .NET web applications, both on the old (.NET Framework 4.8) and new stack (.NET 6). On production, we want to determine on which .NET runtime each application is running.

I could add something like RuntimeInformation.FrameworkDescription to the startup code of each web application and log it.

I'd like to know whether there is a more elegant solution, e. g. via a tool. I played around with both dotnet-monitor and dotnet-counters, but I didn't find any API which returns the .NET runtime version of the .NET process.

Thx!

0

There are 0 best solutions below