You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Support setting Server GC and other properties from runtimeconfig.json via MSBuild properties #474
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.
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.
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.
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.
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.
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 - 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?
@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?
@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.
Activity
eerhardt commentedon Dec 9, 2016
One advantage of the current
runtimeconfig.template.jsonmechanism 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.
davidfowl commentedon Dec 9, 2016
All I want to do is fix the name, .template is unnecessary 😄 . We don't call it app.template.config.
eerhardt commentedon Dec 9, 2016
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.
dsplaisted commentedon Dec 9, 2016
We've got precedent for injecting more things into app.config with automatic binding redirects.
davidfowl commentedon Dec 9, 2016
I want both things 😄
eerhardt commentedon Dec 10, 2016
Oh right. Good point.
dasMulli commentedon Dec 10, 2016
Could this actually modify both
runtimeconfig.jsonandapp.config? would be great to have just one place tocontrol itrule them all if you target both .net core and desktop.DamianEdwards commentedon Jan 27, 2017
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
eerhardt commentedon Jan 31, 2017
@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?
DamianEdwards commentedon Jan 31, 2017
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)
jgoshi commentedon Jan 31, 2017
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
jgoshi commentedon Feb 1, 2017
@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?
dsplaisted commentedon Feb 1, 2017
@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.