dotnet build doesn't write runtime properties to .runtimeconfig.json on .NET 2.1
See original GitHub issueUsing .NET Core 2.1
mkdir repro
cd repro
dotnet new console
Edit repro.csproj
to add ServerGarbageCollection
property:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.1</TargetFramework>
<ServerGarbageCollection>true</ServerGarbageCollection>
</PropertyGroup>
</Project>
dotnet build
Open the repro.runtimeconfig.json
:
{
"runtimeOptions": {
"tfm": "netcoreapp2.1",
"framework": {
"name": "Microsoft.NETCore.App",
"version": "2.1.0"
}
}
}
It should have the System.GC.Server
property:
"configProperties": {
"System.GC.Server": true
}
Running:
dotnet publish
Will produce the correct .runtimeconfig.json
into the publish folder.
Issue Analytics
- State:
- Created 4 years ago
- Comments:9 (8 by maintainers)
Top Results From Across the Web
.NET core 2.1 Custom Nuget package. Problem with ...
Problem with missing *. runtimeconfig. json file in the project where the package was installed.
Read more >runtimeconfig.dev.json file not generated - .NET
The .NET SDK no longer generates the runtimeconfig.dev.json file by default. This file was not used in most scenarios, and finding and loading ......
Read more >Deep-dive into .NET Core primitives, part 3: runtimeconfig. ...
Finally we are using B. runtimeconfig. json (both DLL's has same runtime needs) to execute A. dll like "dotnet exec --runtimepath B.
Read more >.NET SDK Support
The dotnet build command builds the project and its dependencies into a set of ... A .runtimeconfig.json file, which specifies the shared runtime...
Read more >.NET Core buildpack | Cloud Foundry Docs
NET Runtime version, you must modify your app's .runtimeconfig.json file to include the applyPatches property and set the property to false .
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Sorry - I can’t repro it either now. I know I tried it several times yesterday, but now on the same machine it works just fine. I guess I must have run into the incremental build issue without realizing it…
Sorry again for the confusion.
There are two separate issues here:
The one tracked by this bug, which is about the fact that runtime properties are not written to
.runtimeconfig.json
on .NET Core 2.1 (and probably 2.2). It works on 3.0. This is true even for clean/build. Basically this issue is about the discussion whether we can fix it for 2.* apps in some way.The other problem is that changing settings which affect
.runtimeconfig.json
are not triggering rebuild of that file during incrementaldotnet build
. That issue is tracked by #2787 - or it seems so.