Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for runtimeconfig.template.json #2428

Open
dotMorten opened this issue Sep 12, 2023 · 3 comments · Fixed by #2453
Open

Add support for runtimeconfig.template.json #2428

dotMorten opened this issue Sep 12, 2023 · 3 comments · Fixed by #2453

Comments

@dotMorten
Copy link

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.

@timcassell
Copy link
Collaborator

Reopening for someone to add support for runtimeconfig.template.json.

@timcassell timcassell reopened this Oct 27, 2023
@timcassell timcassell changed the title Can't set RuntimeHostConfigurationOption on generated project Add support for runtimeconfig.template.json Oct 27, 2023
@keegan-caruso
Copy link
Contributor

@timcassell It looks like RuntimeHostConfigurationOption is copied over to the autogenerated csproj as expected for a default job.

It is not copied over if using a native AOT toolchain.

Would you like to use this issue to also track that, or would you like me to open a new issue for this?

@timcassell
Copy link
Collaborator

That's surprising, it shares the same csproj generator as the other toolchains. I don't think we need a separate issue, if you want to send a PR and link it to your comment here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants