Description
I don't see a reason why is it useful for a published property value to overwrite dev-only value. The reverse would make more sense.
The fix would be to add a condition to this line that skips the assignment if the property is already present:
|
m_properties[property.name.GetString()] = property.value.GetString(); |
This would technically be a minor breaking change. Since runtimeconfig.dev.json is disabled since .NET 6.0 and before that hasn't been used for specifying properties it shouldn't affect many customers.
We would like to use runtimeconfig.dev.json to specify values for Hot Reload related switches that are only applicable to local development and should be overridden by values in runtimeconfig.json.
Specifically, set both System.Reflection.Metadata.MetadataUpdater.IsSupported and System.StartupHookProvider.IsSupported to true in .runtimeconfig.dev.json and false in .runtimeconfig.json.
Change in the SDK: dotnet/sdk#53715
Reproduction Steps
Console app that prints the value of switches and .runtimeconfig.dev.json and .runtimeconfig.json files specifying different values.
repro.zip
Expected behavior
Values specified in .runtimeconfig.dev.json overwrite values specified in .runtimeconfig.json.
Actual behavior
The reverse
Regression?
No
Known Workarounds
Alternatively, we could use a single .runtimeconfig.json file and change the SDK publishing targets to patch it when publishing.
Description
I don't see a reason why is it useful for a published property value to overwrite dev-only value. The reverse would make more sense.
The fix would be to add a condition to this line that skips the assignment if the property is already present:
runtime/src/native/corehost/runtime_config.cpp
Line 98 in f7fcd1c
This would technically be a minor breaking change. Since
runtimeconfig.dev.jsonis disabled since .NET 6.0 and before that hasn't been used for specifying properties it shouldn't affect many customers.We would like to use
runtimeconfig.dev.jsonto specify values for Hot Reload related switches that are only applicable to local development and should be overridden by values inruntimeconfig.json.Specifically, set both
System.Reflection.Metadata.MetadataUpdater.IsSupportedandSystem.StartupHookProvider.IsSupportedtotruein.runtimeconfig.dev.jsonandfalsein.runtimeconfig.json.Change in the SDK: dotnet/sdk#53715
Reproduction Steps
Console app that prints the value of switches and
.runtimeconfig.dev.jsonand.runtimeconfig.jsonfiles specifying different values.repro.zip
Expected behavior
Values specified in
.runtimeconfig.dev.jsonoverwrite values specified in.runtimeconfig.json.Actual behavior
The reverse
Regression?
No
Known Workarounds
Alternatively, we could use a single
.runtimeconfig.jsonfile and change the SDK publishing targets to patch it when publishing.