The setting server garbage collection in the new SDK project format is not honored for TargetFramework net47, it works for netcoreapp 2.0
<ServerGarbageCollection>true</ServerGarbageCollection>
Steps to repreoduce
- Create Console project
- TargetFramework net47
- Change project format to new format
- Add setting from above to property group
- Put in the main method:
var latencyMode = System.Runtime.GCSettings.LatencyMode;
var isServerGC = System.Runtime.GCSettings.IsServerGC;
Console.WriteLine($"Server: {isServerGC}, Mode: {latencyMode}");
Expected result
- Output:
Server: True, Mode: Interactive
Actual result
- Output is:
Server: False, Mode: Interactive
Note: if you multi target the project with <TargetFrameworks>net47;netcoreapp2.0</TargetFrameworks
you can see that the setting is properly used in .net core 2.0
This bug is kinda annoying since it means my Web App for ASP.NET Core 2.0 on .NET 4.7 is running on workstation GC and not on server background gc as it's usually done.
All my attempts to set complus_gcServer=true didn't make any difference.
Repro:
ServerGcRepro.zip
For reference:
.NET-Befehlszeilentools (2.0.2)
Product Information:
Version: 2.0.2
Commit SHA-1 hash: a04b4bf512
Runtime Environment:
OS Name: Windows
OS Version: 10.0.14393
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\2.0.2\
Microsoft .NET Core Shared Framework Host
Version : 2.0.0
Build : e8b8861ac7faf042c87a5c2f9f2d04c98b69f28d
VS version is VS 2017 15.4.0
The setting server garbage collection in the new SDK project format is not honored for TargetFramework net47, it works for netcoreapp 2.0
Steps to repreoduce
Expected result
Server: True, Mode: InteractiveActual result
Server: False, Mode: InteractiveNote: if you multi target the project with
<TargetFrameworks>net47;netcoreapp2.0</TargetFrameworksyou can see that the setting is properly used in .net core 2.0
This bug is kinda annoying since it means my Web App for ASP.NET Core 2.0 on .NET 4.7 is running on workstation GC and not on server background gc as it's usually done.
All my attempts to
set complus_gcServer=truedidn't make any difference.Repro:
ServerGcRepro.zip
For reference:
VS version is VS 2017 15.4.0