Update GenerateRuntimeConfigurationFiles task to generate Hot Reload runtime options #53715
Open
tmat wants to merge 2 commits into
Open
Update GenerateRuntimeConfigurationFiles task to generate Hot Reload runtime options #53715tmat wants to merge 2 commits into
tmat wants to merge 2 commits into
Conversation
Contributor
|
Due to lack of recent activity, this PR has been labeled as 'Stale'. It will be closed if no further activity occurs within 7 more days. Any new comment will remove the label. |
0036777 to
1a70afa
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the SDK’s runtimeconfig generation pipeline so runtimeconfig.dev.json can be generated for Hot Reload runtime switches (in addition to the existing probing-paths behavior), aligning with the Hot Reload runtime options requirements described in dotnet/runtime#126606.
Changes:
- Split
GenerateRuntimeConfigurationFilesdev-config generation into two independent switches: probing paths vs Hot Reload runtime options. - Update
Microsoft.NET.Sdk.targetsto computeGenerateRuntimeConfigDevFilebased on the new switches and pass the new parameters to the task. - Add unit tests validating
runtimeconfig.dev.jsoncontents for Hot Reload-only, probing-paths-only, both enabled, and both disabled scenarios.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| test/Microsoft.NET.Build.Tasks.Tests/GivenAGenerateRuntimeConfigMultiThreading.cs | Adds coverage for Hot Reload runtime options emission into runtimeconfig.dev.json under different switch combinations. |
| src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.targets | Introduces new MSBuild properties for dev-config generation and wires them into the GenerateRuntimeConfigurationFiles task invocation. |
| src/Tasks/Microsoft.NET.Build.Tasks/GenerateRuntimeConfigurationFiles.cs | Implements Hot Reload runtime switch emission into runtimeconfig.dev.json and gates probing-path generation behind a dedicated switch. |
c56c492 to
3f6c162
Compare
87a437a to
28f6636
Compare
0d022a1 to
8c817a5
Compare
…runtime options to runtimeconfig.dev.json Update dotnet-watch to recognize the new setting.
8c817a5 to
0a61b66
Compare
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.
Update
GenerateRuntimeConfigurationFilestask to generate Hot Reload runtime options toruntimeconfig.dev.jsonThe goal is to enable Hot Reload switches in all Debug builds, even if the project publishes AOT binaries.
We do so by generating
runtimeconfig.dev.json, which overrides settings specified inruntimeconfig.json. The latter gets published while the former is only used for local development, thus the value of runtime switches of the published app can be different (Hot Reload disabled) than for dev builds (Hot Reload enabled).This approach used to be blocked by dotnet/runtime#126606, which was recently fixed via
dotnet/runtime#128383. If the project targets .NET 10 or older the
runtimeconfig.dev.jsonsettings won't overrideruntimeconfig.json. We generate the dev.json file regardless as there is no harm to do so and it keeps the logic simpler.See also discussion on dotnet/runtime#126546
Additionally, enable Hot Reload in dontet-watch when
runtimeconfig.dev.jsonis generated with Hot Reload settings.