dotnet / dotnet/runtime

[browser][CoreCLR] publish with -p:UseMonoRuntime=false fails on macOS

Open
#132,758 4 comments 0 reactions 1 assignee Claimed by @maraf View on GitHub
arch-wasm area-Build-mono needs-author-action
Dominant language
C#
Stars
18.3k
Forks
5.6k
PR merge metrics
PR metrics pending

Description

### Description

When using .NET 11 Preview 7, I cannot *publish* a blazorwasm project when `-p:UseMonoRuntime=false` is specified on the command line or within the `.csproj`.

This works as expected on Windows and Linux; this is strictly limited to macOS.

### Reproduction Steps

```sh
dotnet new blazorwasm -n net11p7-blazorwasm
cd net11p7-blazorwasm
dotnet publish -bl -p:UseMonoRuntime=false
```

### Expected behavior

It works!

### Actual behavior

It errors out:

```
…/dotnet-sdk-11.0.100-preview.7.26381.103/packs/Microsoft.NET.Runtime.WebAssembly.Sdk/11.0.0-preview.7.26381.103/Sdk/BrowserWasmApp.CoreCLR.targets(216,11): error MSB4057: The target "_WasmBuildAppCore" does not exist in the project.
```

[msbuild.binlog.zip](https://github.com/user-attachments/files/31433190/msbuild.binlog.zip)

### Regression?

No.

### Known Workarounds

_No response_

### Configuration

.NET 11 Preview 7
macOS 26.6.2
arm64

### Other information

I'm reminded -- because I filed it -- of a very similar "fails on macOS, works on Linux and Windows" issue: https://github.com/dotnet/runtime/issues/131874

Perhaps macOS needs to be added to the test matrix?

Additionally, I *do* see the same error message on Linux, but *not* in for this repro:

* https://github.com/unoplatform/uno/pull/24200 >
* https://dev.azure.com/uno-platform/Uno%20Platform/_build/results?buildId=230175&view=logs&jobId=479906d2-e536-5e27-68d9-7642a3b6a8bc&j=479906d2-e536-5e27-68d9-7642a3b6a8bc&t=96cb6b92-b175-53d7-ef06-5fb2f6729169

When trying to update a Uno sample to use CoreCLR, it fails to build in the same way:

```
/home/vsts/work/1/s/.dotnet/packs/Microsoft.NET.Runtime.WebAssembly.Sdk/11.0.0-preview.7.26381.103/Sdk/BrowserWasmApp.CoreCLR.targets(216,11): error MSB4057: The target "_WasmBuildAppCore" does not exist in the project. [/home/vsts/work/1/s/src/SamplesApp/SamplesApp/SamplesApp.csproj::TargetFramework=net11.0-browserwasm]
```

I do not yet understand why it would fail in this manner on Uno CI while succeeding within my Linux VM for `dotnet new blazorwasm`, as Uno CI is also on Linux.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.