Why dose runtimeconfig.json contain includedFrameworks instead of frameworks?

Viewed 378

Hello,

I have an AspNet Core application which gets published like this:

dotnet publish -c release MyApplication.csproj

the problem is, that the generated MyApplication.runtimeconfig.json dose contain a includedFrameworks Tag instead of frameworks.

This is what I get:

{
  "runtimeOptions": {
    "tfm": "net5.0",
    "includedFrameworks": [
      {
        "name": "Microsoft.NETCore.App",
        "version": "5.0.10"
      },
      {
        "name": "Microsoft.AspNetCore.App",
        "version": "5.0.10"
      }
    ],
    "configProperties": {
      "System.GC.Server": true,
      "System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": false
    }
  }
}

but I would expect:

{
  "runtimeOptions": {
    "tfm": "net5.0",
    "frameworks": [         // <-------------
      {
        "name": "Microsoft.NETCore.App",
        "version": "5.0.10"
      },
      {
        "name": "Microsoft.AspNetCore.App",
        "version": "5.0.10"
      }
    ],
    "configProperties": {
      "System.GC.Server": true,
      "System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": false
    }
  }
}

Can anyone tell my why dotnet is doing this, bzw how to generate it the right way?

Thank you for your help!

1 Answers

The solution is to add following parameters:

dotnet publish -c Release -p:UseAppHost=false --self-contained false

In my case the application is hosted in IIS.

Related