How do I get the .NET Core runtime version of a Standalone Deployment (SCD) application?


EM0

I published my .NET Core app using dotnet publish -r linux-x64, so it's self-contained and the .NET Core runtime is not installed on the server it's running on. It's built with .NET Core 2.1.something - I think. How can I determine the exact version? Ideally, I'd like to get it at runtime, so the app itself can report the runtime it's running on, but even having some SDK tools reporting it (eg dotnet get-runtime-version My.Assembly.Dll) is better than nothing.

overall developer

When an application is published, it generates My.Assembly.deps.jsonand contains information about the included runtime. Find Microsoft.NETCore.Appthe referenced version .

Example (trimmed to relevant attributes only):

{
  "targets": {
    ".NETCoreApp,Version=v2.2/win-x86": {
      "My.Assembly/1.0.0": {
        "dependencies": {
          "Microsoft.NETCore.App": "2.2.4"
        },
        "runtime": {
          "My.Assembly.dll": {}
        }
      }
    }
  }
}

deps.jsonIt is further documented in the runtime configuration file as part of the .NET Core CLI specification , although it does not directly define the relationship to the runtime version.

Related


How do i attach a python project to a .net core application

Nobinto I have a Visual Studio 2019 and I have a solution. I have 2 projects in the solution, one of them is a traditional .net core 2.2 web application, and now I have a new project, also a python. I also need to copy the python project to the release folder

How do I get the .NET Framework version targeted?

Ian Boyd How can I get the .NET Framework version to target, not the .NET Framework version the application is currently running under? For example, if the application targets .NET Framework 4.5, I need to know that I target .NET Framework 4.5. For example, ch

How to get the Docker version in .NET Core

Henning I'm trying to determine the version of docker in a .NET Core backend. I've had the idea of creating my own environment variables in docker-compose, but I don't know how to get the information docker -vand pass it to the application when it starts. I ho

Map .Net Core Runtime version with .Net Core SDK version

Wakano I just went and got the latest .Net Core 3.1 runtime and SKD container. The latest version of the runtime is 3.1.10 and the latest version of the SDK is 3.1.404. But according to this documentation page , this is not a valid versioning structure. It say

Map .Net Core Runtime version with .Net Core SDK version

Wakano I just went and got the latest .Net Core 3.1 runtime and SKD container. The latest version of the runtime is 3.1.10 and the latest version of the SDK is 3.1.404. But according to this documentation page , this is not a valid versioning structure. It say

Map .Net Core Runtime version with .Net Core SDK version

Wakano I just went and got the latest .Net Core 3.1 runtime and SKD container. The latest version of the runtime is 3.1.10 and the latest version of the SDK is 3.1.404. But according to this documentation page , this is not a valid versioning structure. It say

Map .Net Core Runtime version with .Net Core SDK version

Wakano I just went and got the latest .Net Core 3.1 runtime and SKD container. The latest version of the runtime is 3.1.10 and the latest version of the SDK is 3.1.404. But according to this documentation page , this is not a valid versioning structure. It say