-
Notifications
You must be signed in to change notification settings - Fork 5.3k
[browser][coreclr] Add --UseMonoRuntime parameter to wasmbrowser template (default: true) #122641
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Co-authored-by: maraf <10020471+maraf@users.noreply.github.com>
Co-authored-by: maraf <10020471+maraf@users.noreply.github.com>
Co-authored-by: maraf <10020471+maraf@users.noreply.github.com>
Co-authored-by: maraf <10020471+maraf@users.noreply.github.com>
Co-authored-by: maraf <10020471+maraf@users.noreply.github.com>
|
Tagging subscribers to 'arch-wasm': @lewing, @pavelsavara |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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) |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.