Make runtimeconfig.dev.json configProperties take precedence over runtimeconfig.json#128383
Draft
Copilot wants to merge 4 commits into
Draft
Make runtimeconfig.dev.json configProperties take precedence over runtimeconfig.json#128383Copilot wants to merge 4 commits into
Copilot wants to merge 4 commits into
Conversation
…nfig.json Co-authored-by: elinor-fung <47805090+elinor-fung@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix configurationProperties overwrite issue in runtimeconfig
Make runtimeconfig.dev.json configProperties take precedence over runtimeconfig.json
May 19, 2026
elinor-fung
reviewed
May 20, 2026
Co-authored-by: Elinor Fung <elfung@microsoft.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR changes host runtime configuration parsing so configProperties specified in *.runtimeconfig.dev.json are not overwritten by the same property name in *.runtimeconfig.json (dev config wins for configProperties only). It updates HostActivation tests to validate the new precedence.
Changes:
- Update
runtime_config_t::parse_optsto skip assigning aconfigPropertiesentry if that key already exists inm_properties. - Update the related HostActivation test to assert dev-config precedence.
Show a summary per file
| File | Description |
|---|---|
| src/native/corehost/runtime_config.cpp | Implements “first value wins” for configProperties by skipping overwrites when a key is already present (dev config parsed first). |
| src/installer/tests/HostActivation.Tests/RuntimeProperties.cs | Renames/updates a test to assert .runtimeconfig.dev.json overrides .runtimeconfig.json for the same property name. |
Copilot's findings
Comments suppressed due to low confidence (1)
src/native/corehost/runtime_config.cpp:103
- This adds an extra hash lookup and string conversion per property (
count+ lateroperator[]assignment), and the brace-lessifis inconsistent with the surrounding style in this function. Consider using a single lookup/insert pattern (and braces) so existing entries are skipped without paying for two lookups.
for (const auto& property : properties_obj)
{
if (m_properties.count(property.name.GetString()) != 0)
continue;
if (property.value.IsString())
{
m_properties[property.name.GetString()] = property.value.GetString();
}
- Files reviewed: 2/2 changed files
- Comments generated: 1
elinor-fung
reviewed
May 20, 2026
This was referenced May 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
configPropertiesset in.runtimeconfig.jsoncurrently overwrite values from.runtimeconfig.dev.json, preventing dev-only overrides. This makes them not actually useful in a dev scenario.Technically a breaking change and we will file it as such, but it should be very low-impact. The SDK has disabled emitting
runtimeconfig.dev.jsonby default since .NET 6 and it was never used for properties.