[browser][coreclr] Add --UseMonoRuntime parameter to wasmbrowser template (default: true)#122641
Merged
[browser][coreclr] Add --UseMonoRuntime parameter to wasmbrowser template (default: true)#122641
Conversation
Co-authored-by: maraf <[email protected]>
Co-authored-by: maraf <[email protected]>
Co-authored-by: maraf <[email protected]>
Copilot
AI
changed the title
[WIP] Update wasmbrowser template to add usemonoruntime parameter
Add --UseMonoRuntime parameter to wasmbrowser template (default: true)
Dec 18, 2025
maraf
reviewed
Dec 19, 2025
Co-authored-by: maraf <[email protected]>
maraf
reviewed
Dec 19, 2025
Co-authored-by: maraf <[email protected]>
Copilot
AI
changed the title
[browser][coreclr] Add --UseMonoRuntime parameter to wasmbrowser template (default: true)
Add --UseMonoRuntime parameter to wasmbrowser template (default: true)
Dec 19, 2025
Contributor
|
Tagging subscribers to 'arch-wasm': @lewing, @pavelsavara |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds a new --UseMonoRuntime boolean parameter to the wasmbrowser dotnet template that controls whether the generated project explicitly opts out of the Mono runtime. The parameter defaults to true, and when set to false, the template emits <UseMonoRuntime>false</UseMonoRuntime> in the generated project file to enable CoreCLR for WebAssembly scenarios.
Key Changes:
- Added
UseMonoRuntimetemplate parameter with boolean type andtruedefault value - Implemented inverted conditional logic in project template to emit property only when parameter is
false - Added comprehensive test coverage for all parameter scenarios (true, false, and default)
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/mono/wasm/templates/templates/browser/.template.config/template.json | Adds the UseMonoRuntime boolean parameter definition with default value true and appropriate description |
| src/mono/wasm/templates/templates/browser/browser.0.csproj | Adds conditional template directive to emit <UseMonoRuntime>false</UseMonoRuntime> only when parameter is set to false |
| src/mono/wasm/Wasm.Build.Tests/Templates/WasmTemplateTests.cs | Adds test method UseMonoRuntimeParameter to verify correct behavior for all parameter values (true, false, default) |
pavelsavara
approved these changes
Dec 19, 2025
ilonatommy
approved these changes
Dec 19, 2025
Co-authored-by: Copilot <[email protected]>
This was referenced Jan 9, 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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Description
Adds a
--UseMonoRuntimeboolean parameter to thewasmbrowsertemplate that controls whether<UseMonoRuntime>false</UseMonoRuntime>is included in the generated project file when the parameter is set tofalse. Default istrue.Template changes:
UseMonoRuntimesymbol intemplate.json(boolean, default: true)browser.0.csprojusing template engine directives with inverted logicUsage:
The logic is inverted so that
<UseMonoRuntime>false</UseMonoRuntime>is only emitted when the parameter is explicitly set tofalse. Whentrue(default), no property is emitted since Mono runtime is the default behavior for WebAssembly browser apps.Testing:
UseMonoRuntimeParametertest covering true/false/default casesContributes to dotnet/sdk#51240
Original prompt
This pull request was created from Copilot chat.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.