Skip to content

Support setting Server GC and other properties from runtimeconfig.json via MSBuild properties #474

Closed

Description

@dsplaisted

Currently, to use the Server GC, you need to have a runtimeconfig.template.json file with the setting, which is then merged into the runtimeconfig.json that the app uses.

We should add an MSBuild property to set the GC mode (and any other important properties from the runtimeconfig) that will get written to the output runtimeconfig without having to have the template .json file in your project. The Web Sdk should set this property to Server GC by default.

Activity

  1. eerhardt commented on Dec 9, 2016

    @eerhardt
    Member

    One advantage of the current runtimeconfig.template.json mechanism is that the runtime can add new config settings without the tooling needing to support the new setting (i.e. you can use v1 tooling with v1.2 runtime and still configure the new settings that came in v1.2 runtime).

    If we have both mechanisms (MSBuild properties and runtimeconfig.template.json), we need to figure out conflict resolution between the two.

    I don't disagree with adding these settings as MSBuild properties, but it does feel odd for MSBuild properties to set them. The runtimeconfig.json is roughly analogous to the '.NET runtime' sections of App.config in the desktop framework, and those settings don't appear as MSBuild properties.

  2. davidfowl commented on Dec 9, 2016

    @davidfowl
    Member

    One advantage of the current runtimeconfig.template.json mechanism is that the runtime can add new config settings without the tooling needing to support the new setting (i.e. you can use v1 tooling with v1.2 runtime and still configure the new settings that came in v1.2 runtime).

    All I want to do is fix the name, .template is unnecessary 😄 . We don't call it app.template.config.

  3. eerhardt commented on Dec 9, 2016

    @eerhardt
    Member

    That's fair. The reasoning it was named that is because more values get injected into the final .json file than what is in the user's .json file. For example, the shared framework version is added to the final file.

  4. dsplaisted commented on Dec 9, 2016

    @dsplaisted
    MemberAuthor

    We've got precedent for injecting more things into app.config with automatic binding redirects.

  5. davidfowl commented on Dec 9, 2016

    @davidfowl
    Member

    I want both things 😄

  6. eerhardt commented on Dec 10, 2016

    @eerhardt
    Member

    We've got precedent for injecting more things into app.config with automatic binding redirects.

    Oh right. Good point.

  7. dasMulli commented on Dec 10, 2016

    @dasMulli
    Contributor

    Could this actually modify both runtimeconfig.json and app.config? would be great to have just one place to control it rule them all if you target both .net core and desktop.

  8. added this to the 1.0 RC3 milestone on Dec 21, 2016
  9. modified the milestones: 1.0 RC3, 1.0 RTM on Jan 11, 2017
  10. DamianEdwards commented on Jan 27, 2017

    @DamianEdwards
    Member

    I'd really like to avoid Yet Another File in all ASP.NET Core projects just so we can default the GC to the correct value. MSBUILD property works for that, or perhaps Microsoft.Net.Web.SDK can do something to set it in the resultant runtimeconfig.json. How would that look?

    @mlorbetske

  11. eerhardt commented on Jan 31, 2017

    @eerhardt
    Member

    @mlorbetske - Now that this is fixed, what is the plan for the Web projects to uptake the work? Will the Web.Sdk default this MSBuild property? Or will the Web templates be updated?

  12. DamianEdwards commented on Jan 31, 2017

    @DamianEdwards
    Member

    The Web.Sdk should set this by default, and the templates/migrate need to be updated too (see https://github.com/dotnet/cli/issues/5526)

  13. jgoshi commented on Jan 31, 2017

    @jgoshi
    Contributor

    Which version of the Web.Sdk is setting this by default? Do I need to make sure we are using a specific version before removing it from https://github.com/dotnet/cli/issues/5526

  14. jgoshi commented on Feb 1, 2017

    @jgoshi
    Contributor

    @mlorbetske @DamianEdwards Is the Web.Sdk setting ServerGarbageCollection to true by default? I am working on a change to the CLI to remove runtimeconfig.template.json completely from our web templates (used by dotnet new). In addition, for migration I am not injecting the ServerGarbageCollection property if it's set to true in the project.json file (since I'm relying on Web.Sdk to do that by default). Which version of the Web sdk do I need to use? How can I verify that this is working properly?

  15. dsplaisted commented on Feb 1, 2017

    @dsplaisted
    MemberAuthor

    @jgoshi Here's the PR where this was added to the Web SDK: dotnet/websdk#110 It was merged yesterday, I don't know what that means in terms of what version of the SDK it will be in.

  16. added theissue type on Aug 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions