SDK 11.0.100 no longer sets SelfContained=true for browser-wasm projects, so net10.0 WASM apps that built on SDK 10 fail
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 48/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- csharp, wasm
- Lĩnh vực
- build-system
Hướng nghiên cứu
Compare the SDK 10 and SDK 11 Mono toolchain manifest targets named in the report, including the net10 manifest, and trace how SelfContained is set for browser-wasm projects. Start by reproducing the provided net10.0 project with SDK 11.0.100 and wasm-tools-net10; confirm the property and build behavior. Done means the runtime pack is resolved and the reproduction builds as it does with SelfContained=true.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Description
A net10.0 project with RuntimeIdentifier=browser-wasm (plain Microsoft.NET.Sdk) builds on SDK 10 but fails on SDK 11.0.100 with the wasm-tools-net10 workload installed.
On SDK 10, the Mono toolchain workload manifest sets SelfContained=true for every browser-wasm project
(sdk-manifests/10.0.100/microsoft.net.workload.mono.toolchain.current/<version>/WorkloadManifest.targets):
<PropertyGroup Condition="'$(RuntimeIdentifier)' == 'browser-wasm'">
<SelfContained>true</SelfContained>
On SDK 11.0.100, neither microsoft.net.workload.mono.toolchain.current nor microsoft.net.workload.mono.toolchain.net10 sets it. The SDK's own default (SelfContained=false for net8.0+ when only a RID is set) applies, so no runtime pack is resolved and the WASM build fails. A browser-wasm app cannot run without its runtime, so this looks unintended. I could not find it listed as a breaking change.
Reproduction Steps
Repro.csproj:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
<RuntimeIdentifier>browser-wasm</RuntimeIdentifier>
<OutputType>Exe</OutputType>
</PropertyGroup>
</Project>
Program.cs:
System.Console.WriteLine("hello");
Then:
dotnet workload install wasm-tools-net10
dotnet build
dotnet msbuild -getProperty:SelfContained
Expected behavior
Builds, as on SDK 10.0.404 with wasm-tools; SelfContained evaluates to true.
Actual behavior
On SDK 11.0.100, SelfContained evaluates to false and the build fails:
Microsoft.NET.Runtime.WebAssembly.Sdk\10.0.15\Sdk\WasmApp.Common.targets(368,5): error : WasmAssembliesToBundle item is empty. No assemblies to process
In a larger project of the same kind (also WasmBuildNative=true, WasmAppDir set, a SQLite native package reference), the build instead fails earlier with:
Microsoft.NET.Runtime.WebAssembly.Sdk\10.0.15\Sdk\WasmApp.Common.targets(283,5): error : $(MicrosoftNetCoreAppRuntimePackDir)='', and cannot find %(ResolvedRuntimePack.PackageDirectory)=. One of these need to be set to a valid path
Setting SelfContained=true fixes both.
| SDK | Workload | SelfContained |
Build |
|---|---|---|---|
10.0.404 (Linux, mcr.microsoft.com/dotnet/sdk:10.0-noble) |
wasm-tools |
true |
succeeds |
| 11.0.100 (Windows) | wasm-tools-net10 |
false |
fails |
11.0.100 with -p:SelfContained=true |
wasm-tools-net10 |
true |
succeeds |
The same repro targeting net11.0 with wasm-tools on SDK 11.0.100 fails with the MicrosoftNetCoreAppRuntimePackDir error above.
Regression?
Yes. Works on SDK 10.0.404; fails on SDK 11.0.100.
Known Workarounds
Set <SelfContained>true</SelfContained> in the project.
Configuration
- SDK 11.0.100, Windows 11 x64; also reproduced on a Windows build agent with SDK 11.0.100
- Workload
wasm-tools-net10, manifest 11.0.100 (WebAssembly SDK pack 10.0.15) - Comparison: SDK 10.0.404 on Linux x64 (Docker), workload
wasm-tools10.0.115 manifests
Other information
Projects using the Blazor/WebAssembly SDKs may not be affected; not verified.
- Ngôn ngữ chính
- C#
- Star
- 18.4k
- Fork
- 5.8k
- Merge trung bình
- 2 ngày 19 giờ
- Pull request đã merge (30 ngày)
- 590
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của dotnet/runtime
-
area-Setup untriaged
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
dotnet/runtime#137376 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area-System.Memory untriaged
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
dotnet/runtime#137334 · 4 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
ImmutableSortedSet<T>.Builder: enumerating through IEnumerable<T> doesn't throw on modification and can return wrong itemsCó thể đã có người làm @aw0lid đã nhận 3 ngày trước. Đang mởarea-System.Collections
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
dotnet/runtime#137167 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
DbTransaction.SupportsSavepoints docs say Release/ReleaseAsync are expected to throw, but they are no-ops by designCó thể đã có người làm @alaricd đã nhận 7 ngày trước. Đang mởarea-System.Transactions untriaged
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
dotnet/runtime#137040 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
FileSystemGlobbing: Matcher throws ArgumentOutOfRangeException when the rootDir is the same value as the fileCó thể đã có người làm @makazeu đã nhận 7 ngày trước. Đang mởarea-Extensions-FileSystem
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
dotnet/runtime#136989 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của dotnet/runtime
Issue tương tự
-
bug emitter:client:csharp
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
microsoft/typespec#12572 · 1 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
needs-area-label
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 2 ngày
-
AWS Lambda: KeyNotFoundException drops HTTP-triggered transactions when allowAllHeaders is disabledĐang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
newrelic/newrelic-dotnet-agent#3949 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area-networking
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
dotnet/aspnetcore#70545 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 87/100
Maintainer thường phản hồi trong vòng 1 ngày