-
Notifications
You must be signed in to change notification settings - Fork 5.2k
[wasm] Remove UseMonoRuntime=true from SDK #121789
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
base: main
Are you sure you want to change the base?
Conversation
|
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 removes UseMonoRuntime=true property assignments from two WebAssembly SDK build files, claiming they are duplicates of a property set in the external dotnet/sdk WasmSDK repository.
- Removes unconditional
UseMonoRuntime=truefromWasmApp.Common.props - Removes conditional
UseMonoRuntime=truefromMicrosoft.NET.Runtime.WebAssembly.Sdk/Sdk/Sdk.props
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/mono/wasm/build/WasmApp.Common.props | Removes unconditional UseMonoRuntime=true assignment that applies to all projects using the WebAssembly SDK |
| src/mono/nuget/Microsoft.NET.Runtime.WebAssembly.Sdk/Sdk/Sdk.props | Removes conditional UseMonoRuntime=true assignment that only applies when NOT using external Blazor/WebAssembly SDKs |
| @@ -1,8 +1,7 @@ | |||
| <Project> | |||
| <PropertyGroup Condition="'$(UsingMicrosoftNETSdkBlazorWebAssembly)' != 'true' and '$(UsingMicrosoftNETSdkWebAssembly)' != 'true'"> | |||
Copilot
AI
Nov 28, 2025
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.
Removing this conditional assignment may break scenarios where projects use Microsoft.NET.Sdk (not the WebAssembly SDK) with RuntimeIdentifier=browser-wasm.
The condition '$(UsingMicrosoftNETSdkBlazorWebAssembly)' != 'true' and '$(UsingMicrosoftNETSdkWebAssembly)' != 'true' specifically handles cases where the external dotnet/sdk WebAssembly or Blazor SDKs are NOT being used. For example, the console template at src/mono/wasm/templates/templates/console/console.0.csproj uses Microsoft.NET.Sdk with RuntimeIdentifier=browser-wasm, which would fall into this category.
If the external dotnet/sdk WasmSDK only sets UseMonoRuntime=true when UsingMicrosoftNETSdkWebAssembly is true, then removing both this conditional assignment and the unconditional one from WasmApp.Common.props would leave UseMonoRuntime unset for these scenarios.
Please verify that the external WasmSDK sets UseMonoRuntime=true for ALL scenarios where browser-wasm or wasi-wasm runtime identifiers are used, not just when using the Microsoft.NET.Sdk.WebAssembly SDK.
| @@ -1,7 +1,6 @@ | |||
| <Project> | |||
| <PropertyGroup> | |||
| <TargetArchitecture>wasm</TargetArchitecture> | |||
Copilot
AI
Nov 28, 2025
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.
Removing this unconditional assignment could break scenarios where UseMonoRuntime is not set by the external dotnet/sdk WasmSDK.
This file is imported via BrowserWasmApp.props → Sdk.targets and applies to all projects using Microsoft.NET.Runtime.WebAssembly.Sdk, including those that don't use Microsoft.NET.Sdk.WebAssembly or Microsoft.NET.Sdk.BlazorWebAssembly.
Before removing this, please confirm that:
- The external WasmSDK sets
UseMonoRuntime=truefor projects withRuntimeIdentifier=browser-wasmregardless of which SDK they use - Or that
Microsoft.NET.Runtime.WebAssembly.Sdk/Sdk/Sdk.propsconditional assignment remains to cover non-WebAssembly-SDK scenarios
Since both assignments are being removed in this PR, there may be no fallback for projects that use Microsoft.NET.Sdk + wasm-tools workload instead of the WebAssembly SDK directly.
All the removed assignments are duplicates. We have the property set in WasmSDK at https://github.com/dotnet/sdk/blob/main/src/WasmSdk/Sdk/Sdk.props#L18