Blazor Wasm PWA with AOT, publish build is not working after upgrade to .NET 9

オープン
#111,663 コメント 9 件 リアクション 1 件 担当者 1 名 GitHub で見る

まだ誰も着手していません。

評価

この issue はまだ評価されていません。

説明

arch-wasm area-Build-mono os-browser
Is there an existing issue for this?
  • I have searched the existing issues
Describe the bug

Last week, I upgraded my Blazor Wasm PWA from .NET 7 to .NET 9. I tested everything, created a publish build and published it. It works without any problems.
So, I continued the work on the app and wanted to test something today. To do so, I created a publish build with <RunAOTCompilation>false</RunAOTCompilation>, simply because compilation is faster without AOT. The build was successful but the app cannot be loaded in the browser. One error message says, that Blazored.LocalStorage throws a Not Implemented Yet exception:

MONO interpreter: NIY encountered in method Blazored.LocalStorage.ServiceCollectionExtensions:AddBlazoredLocalStorage (Microsoft.Extensions.DependencyInjection.IServiceCollection)

So, I already started a bug report at the Blazored.LocalStorage github repo, but then found out that this package cannot be the (only) reason for the error. Let me explain:
In this case, 3 things can make the app crash:

  • I modified the code,
  • Blazored.LocalStorage is not ready for .NET 9 and
  • I changed with/without AOT

I tested all 8 combinations (with/without code changes, with/without Blazored.LocalStorage, with/without AOT). The only 2 cases, I can make the app run, are

  • without changes, without AOT, without Blazored.LocalStorage
  • with changes, without AOT, without Blazored.LocalStorage

Okay, it only works without Blazored.LocalStorage. That's why I first thought, this package causes the error. But it also does not work

  • without changes, with AOT, without Blazored.LocalStorage

So, I tried to go back to .NET 7, but without success. I cannot make the app run. That's a severe problem, because I cannot publish updates currently.

Here are some error messages

MONO interpreter: NIY encountered in method Blazored.LocalStorage.ServiceCollectionExtensions:AddBlazoredLocalStorage (Microsoft.Extensions.DependencyInjection.IServiceCollection) dotnet.runtime.o8gq1i8bk6.js:3 [MONO] * Assertion: should not be reached at /__w/1/s/src/mono/mono/mini/interp/interp.c:3965

Error
at Fc (https://[...].netlify.app/_framework/dotnet.runtime.o8gq1i8bk6.js:3:168644)
at https://[...].netlify.app/_framework/dotnet.native.8uqnh0fgel.wasm:wasm-function[8300]:0x1faf36
at https://[...].netlify.app/_framework/dotnet.native.8uqnh0fgel.wasm:wasm-function[792]:0x3e9ad
at https://[...].netlify.app/_framework/dotnet.native.8uqnh0fgel.wasm:wasm-function[713]:0x3ca50
at https://[...].netlify.app/_framework/dotnet.native.8uqnh0fgel.wasm:wasm-function[717]:0x3cb71
at https://[...].netlify.app/_framework/dotnet.native.8uqnh0fgel.wasm:wasm-function[720]:0x3cbda
at https://[...].netlify.app/_framework/dotnet.native.8uqnh0fgel.wasm:wasm-function[93]:0x7e8d
at https://[...].netlify.app/_framework/dotnet.native.8uqnh0fgel.wasm:wasm-function[130]:0x16b93
at https://[...].netlify.app/_framework/dotnet.native.8uqnh0fgel.wasm:wasm-function[2902]:0xcfdb8
at https://[...].netlify.app/_framework/dotnet.native.8uqnh0fgel.wasm:wasm-function[2266]:0xa6af7
Fc @ dotnet.runtime.o8gq1i8bk6.js:3
blazor.webassembly.js:1
ExitStatusmessage: "Program terminated with exit(1)"name: "ExitStatus"status: 1[[Prototype]]: Object

dotnet.runtime.o8gq1i8bk6.js:3 [MONO] /__w/1/s/src/mono/mono/mini/aot-runtime.c:2139 Error at Fc (https://neon-rabanadas-970146.netlify.app/_framework/dotnet.runtime.o8gq1i8bk6.js:3:168644) at https://neon-rabanadas-970146.netlify.app/_framework/dotnet.native.xw1lrtwtqd.wasm:wasm-function[77113]:0x1589a96 at https://neon-rabanadas-970146.netlify.app/_framework/dotnet.native.xw1lrtwtqd.wasm:wasm-function[69624]:0x13be1ea at https://neon-rabanadas-970146.netlify.app/_framework/dotnet.native.xw1lrtwtqd.wasm:wasm-function[69547]:0x13bc122 at https://neon-rabanadas-970146.netlify.app/_framework/dotnet.native.xw1lrtwtqd.wasm:wasm-function[69549]:0x13bc1ef at https://neon-rabanadas-970146.netlify.app/_framework/dotnet.native.xw1lrtwtqd.wasm:wasm-function[69550]:0x13bc225 at https://neon-rabanadas-970146.netlify.app/_framework/dotnet.native.xw1lrtwtqd.wasm:wasm-function[71818]:0x145b471 at https://neon-rabanadas-970146.netlify.app/_framework/dotnet.native.xw1lrtwtqd.wasm:wasm-function[70066]:0x13dcfd0 at https://neon-rabanadas-970146.netlify.app/_framework/dotnet.native.xw1lrtwtqd.wasm:wasm-function[70071]:0x13dd9cc at https://neon-rabanadas-970146.netlify.app/_framework/dotnet.native.xw1lrtwtqd.wasm:wasm-function[70063]:0x13dccbb Fc @ dotnet.runtime.o8gq1i8bk6.js:3 dotnet.runtime.o8gq1i8bk6.js:3 MONO_WASM: mono_wasm_load_runtime () failed [object Object] Pe @ dotnet.runtime.o8gq1i8bk6.js:3 dotnet.runtime.o8gq1i8bk6.js:3 Uncaught (in promise) ExitStatus dotnet.runtime.o8gq1i8bk6.js:3 Uncaught (in promise) ExitStatus blazor.webassembly.js:1 Uncaught (in promise) Error: Failed to start platform. Reason: [object Object] at qt (blazor.webassembly.js:1:55616)

There is a bug report, that is similar to mine, but no solution is provided.

Any help is highly appreciated, because I cannot continue working.
Please let me know, if you need any information.

Many thanks

Philipp

Expected Behavior

No response

Steps To Reproduce

No response

Exceptions (if any)

No response

.NET Version

9

Anything else?

No response

主要言語
C#
スター
18.3k
フォーク
5.6k
平均マージ
2日 19時間
マージ済み PR(30日)
589

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

dotnet/runtime のほかの issue

dotnet/runtime の issue をすべて見る

似ている issue

C# の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。