Skip to content

Add support for runtimeconfig.template.json #2428

Open
@dotMorten

Description

@dotMorten

If I add RuntimeHostConfigurationOption to the benchmark project like this:

<ItemGroup>
    <RuntimeHostConfigurationOption Include="System.Runtime.Loader.UseRidGraph" Value="true" />
  </ItemGroup>

The built project will have this added to [appname].runtimeconfig.json:

{
  "runtimeOptions": {
     "configProperties": {
        "System.Runtime.Loader.UseRidGraph": true
     }
  }
}

This is important to be able to deal with this breaking change in .NET 8:

https://learn.microsoft.com/en-us/dotnet/core/compatibility/deployment/8.0/rid-asset-list#recommended-action

However, the generated project does not copy this setting over, so the resulting project will not get the correct value injected into its runtimeconfig.json.
An alternative way is to add a runtimeconfig.template.json file with the above json, but again, the generated project will not pick this up.

Perhaps

private static readonly ImmutableArray<string> SettingsWeWantToCopy = new[]
needs RuntimeHostConfigurationOption added, and also a way to make sure runtimeconfig.template.json files are copied as well.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions