Skip to content

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

Merged
srivatsn merged 2 commits into
dotnet:masterfrom
eerhardt:AddServerGC
Jan 30, 2017
Merged

srivatsn merged 2 commits into
dotnet:masterfrom
eerhardt:AddServerGC

Conversation

@eerhardt

@eerhardt eerhardt commented Jan 27, 2017 •

Copy link
Copy Markdown
Member

@nguerrera @dsplaisted @srivatsn

/cc @davidfowl @mlorbetske @DamianEdwards

With this change the Web.Sdk can default <ServerGarbageCollection>true</ServerGarbageCollection> in their .props file, and server GC will be turned on for .NET Core apps.

Fix #474

@nguerrera

Copy link
Copy Markdown
Contributor

I don't think we'll get this past ship room so it'll probably have to go in future.

@nguerrera nguerrera left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the feature and the code but it doesn't meet the RTW bar IMHO.

Note that you need to fill out the template (see other recent PRs) and tag Matt Gertz for approval to bring to ship room then wait for approval to merge.

If it gets rejected, ship it in future.

@eerhardt

eerhardt commented Jan 27, 2017 •

Copy link
Copy Markdown
Member Author

@davidfowl @mlorbetske @DamianEdwards - if you guys want me to push for this in "1.0", let me know. But if you don't want/need it, I can just push it to "future".

@DamianEdwards

Copy link
Copy Markdown
Member

@eerhardt I'd like us to push for this in 1.0, thanks.

@eerhardt

Copy link
Copy Markdown
Member Author

@MattGertz for approval

Scenario

ASP.NET projects want Server Garbage Collection turned on by default. The only way to do this today is to add a new file runtimeconfig.template.json in the project and set a single property in the JSON. This clutters up the ASP.NET project with yet another .json file (there are already 5 .json files in the root of the project for a "StarterWeb" template).

Instead, this allows the setting to be controlled by an MSBuild property. The Web.Sdk could default "Server Garbage Collection" to on without affecting the user's project or templates at all. Or the ASP.NET team can add the single MSBuild property into the web template. However, they choose to take advantage of this feature.

Either way, the developer still has full control, and can turn the property back off, if they don't want server garbage collection.

Bug

#474

Workarounds

The workaround is to add a runtimeconfig.template.json file to the project that looks like:

{
  "configProperties": {
    "System.GC.Concurrent": true
  }
} 

Risk

Low - new functionality with no change to existing functionality

Performance Impact

For build time, no impact.
For runtime, using server garbage collection in web apps can improve the performance of the web application. See https://msdn.microsoft.com/en-us/library/ee787088(v=vs.110).aspx#workstation_and_server_garbage_collection

Regression Analysis

Not a regression

@dasMulli

Copy link
Copy Markdown
Contributor

Does this only modify the runtimeconfig.json or will this also update/generate any present App.config / web.config for full framework applications?

@eerhardt

Copy link
Copy Markdown
Member Author

Does this only modify the runtimeconfig.json or will this also update/generate any present App.config / web.config for full framework applications?

This is only for .NET Core applications. Full framework applications can still set the property in the App.config/Web.config. A future enhancement could take these properties and set the values in the app/web.config.

@MattGertz

Copy link
Copy Markdown

Sri/JoC/I are discussing.

@MattGertz

Copy link
Copy Markdown

Talked to JoC; OK to bring to Shiproom. Cost/risk will be the discussion there.

@eerhardt

Copy link
Copy Markdown
Member Author

@

@eerhardt

Copy link
Copy Markdown
Member Author

@MattGertz - I don't have an invite for shiproom. Let me know if there is anything for me to do, or send me the invite if you want me to attend.

@MattGertz

Copy link
Copy Markdown

No worries, Sri usually speaks for SDK, and John's already aware of the existence of this one anyway now.

@natidea

natidea commented Jan 30, 2017

Copy link
Copy Markdown
Contributor

Approved to merge via 377254 and pending one more review

@srivatsn

Copy link
Copy Markdown
Contributor

Thanks Eric!

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants