dotnet / runtime

.NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps.
https://docs.microsoft.com/dotnet/core/
MIT License
14.98k stars 4.66k forks source link

After upgrade to 8.0.0, setting AOT compilation to true breaks published Blazor app on Windows 10 if using LazyLoaded references #96004

Closed Sean4572435243 closed 6 months ago

Sean4572435243 commented 9 months ago

Is there an existing issue for this?

Describe the bug

This is a corollary to this same issue that now has a workaround: https://github.com/dotnet/runtime/issues/95322. I'm breaking out a specific lingering problem with Windows 10 here.

In the mentioned issue 95322, AOT compilation breaks Blazor if it utilizes LazyLoaded references. This came about because in 8.0.0, now the WasmDedup setting in the csproj is set to true by default (historically was false). By inserting

<WasmDedup>false</WasmDedup>

into the csproj, the Blazor app loads and works as expected; but only on my Windows 11 VM on my development laptop.

I then tested the Blazor app on my Windows 10 sanity VM on my server, and it continues to exhibit breaking problems, which is quite strange given the following:

I hope this sufficiently isolates the issue to AOT:true and Windows 10. The specs for the Win 10 machine:

(Edition    Windows 10 Pro
Version 22H2
Installed on    ‎6/‎13/‎2022
OS build    19045.3693
Experience  Windows Feature Experience Pack 1000.19053.1000.0) 

Expected Behavior

Expect Blazor to work ubiquitously or nowhere, given the same published code and Chrome version. To have OS or possibly hardware distinctions that break the app, seems difficult to mitigate or predict.

Steps To Reproduce

Unfortunately I do not have the time resources necessary to carve out this issue

Exceptions (if any)

dotnet.runtime.8.0.0.14kkjimq5k.js:3 [MONO] DllImport error loading library '__Internal': ''.
dotnet.runtime.8.0.0.14kkjimq5k.js:3 [MONO] DllImport error loading library '__Internal': ''.
dotnet.runtime.8.0.0.14kkjimq5k.js:3 Uncaught (in promise)    at Microsoft.AspNetCore.Components.WebAssembly.Services.DefaultWebAssemblyJSRuntime.__Wrapper_EndInvokeJS_15588484(JSMarshalerArgument* __arguments_buffer)
Error: EndOfStringNotFound LineNumber: 0 | BytePositionInLine: 38.
    at Jn (https://mytesturl/_framework/dotnet.runtime.8.0.0.14kkjimq5k.js:3:31614)
    at kr (https://mytesturl/_framework/dotnet.runtime.8.0.0.14kkjimq5k.js:3:35529)
    at Object.<anonymous> (https://mytesturl/_framework/dotnet.runtime.8.0.0.14kkjimq5k.js:3:179811)
    at Object.endInvokeJSFromDotNet (https://mytesturl/_framework/blazor.webassembly.js:1:44925)
    at https://mytesturl/_framework/blazor.webassembly.js:1:2967
Jn @ dotnet.runtime.8.0.0.14kkjimq5k.js:3
kr @ dotnet.runtime.8.0.0.14kkjimq5k.js:3
(anonymous) @ dotnet.runtime.8.0.0.14kkjimq5k.js:3
endInvokeJSFromDotNet @ blazor.webassembly.js:1
(anonymous) @ blazor.webassembly.js:1
Promise.then (async)
beginInvokeJSFromDotNet @ blazor.webassembly.js:1
bn @ blazor.webassembly.js:1
(anonymous) @ dotnet.runtime.8.0.0.14kkjimq5k.js:3
Ul @ dotnet.runtime.8.0.0.14kkjimq5k.js:3
$func64254 @ dotnet.native.wasm:0xc9f023
$func69911 @ dotnet.native.wasm:0xdb0ea5
$func9630 @ dotnet.native.wasm:0x28a0c6
$func17491 @ dotnet.native.wasm:0x50028c
$do_jit_call_indirect @ c7cbb3c6:0x56
$func11212 @ dotnet.native.wasm:0x3061d6
$func4970 @ dotnet.native.wasm:0x15b366
$func699 @ dotnet.native.wasm:0x802bf
$func55423 @ dotnet.native.wasm:0xb5b287
$func83132 @ dotnet.native.wasm:0x10783cd
$func84004 @ dotnet.native.wasm:0x10a8c1a
$func35064 @ dotnet.native.wasm:0x903931
$func60671 @ dotnet.native.wasm:0xc23212
$func3760 @ dotnet.native.wasm:0x10f429
$func20140 @ dotnet.native.wasm:0x594437
$func84003 @ dotnet.native.wasm:0x10a85b6
$func84002 @ dotnet.native.wasm:0x10a842a
$func84006 @ dotnet.native.wasm:0x10a8ea1
$func83081 @ dotnet.native.wasm:0x1072eb5
$func60670 @ dotnet.native.wasm:0xc22f1a
$func3759 @ dotnet.native.wasm:0x10f3e6
$func20148 @ dotnet.native.wasm:0x594757
$func83084 @ dotnet.native.wasm:0x10753b0
$func37773 @ dotnet.native.wasm:0x9901f7
$func60671 @ dotnet.native.wasm:0xc23212
$func37776 @ dotnet.native.wasm:0x9909ed
$func90237 @ dotnet.native.wasm:0x11fabb1
$func14207 @ dotnet.native.wasm:0x3e23f0
$func9580 @ dotnet.native.wasm:0x28765f
$func37624 @ dotnet.native.wasm:0x981b58
$func60671 @ dotnet.native.wasm:0xc23212
$func90089 @ dotnet.native.wasm:0x11f395f
$func37115 @ dotnet.native.wasm:0x9658f2
$func37120 @ dotnet.native.wasm:0x966219
$func60671 @ dotnet.native.wasm:0xc23212
$func88768 @ dotnet.native.wasm:0x11b051e
$func87855 @ dotnet.native.wasm:0x117fe8b
$func37143 @ dotnet.native.wasm:0x96a7c3
$func37122 @ dotnet.native.wasm:0x967477
$func22495 @ dotnet.native.wasm:0x64b257
$func60636 @ dotnet.native.wasm:0xc227a2
$func22232 @ dotnet.native.wasm:0x618aba
$func57147 @ dotnet.native.wasm:0xba9313
$func2660 @ dotnet.native.wasm:0xd192c
$func60634 @ dotnet.native.wasm:0xc226a9
$func22494 @ dotnet.native.wasm:0x64b1cd
$func60635 @ dotnet.native.wasm:0xc22788
$func272 @ dotnet.native.wasm:0x72692
$func17491 @ dotnet.native.wasm:0x500279
$do_jit_call_indirect @ c7cbb3c6:0x56
$func11212 @ dotnet.native.wasm:0x3061d6
$func4970 @ dotnet.native.wasm:0x15b290
$func699 @ dotnet.native.wasm:0x802bf
$func55407 @ dotnet.native.wasm:0xb5ac45
$func4698 @ dotnet.native.wasm:0x141026
$func22288 @ dotnet.native.wasm:0x61bcb1
$func8159 @ dotnet.native.wasm:0x23502c
$func19344 @ dotnet.native.wasm:0x574d63
$func5132 @ dotnet.native.wasm:0x172389
$func3237 @ dotnet.native.wasm:0xf2167
$func6379 @ dotnet.native.wasm:0x1b6e5c
$func22476 @ dotnet.native.wasm:0x649e1c
$func3688 @ dotnet.native.wasm:0x10ac8d
$func37138 @ dotnet.native.wasm:0x969c96
$func22495 @ dotnet.native.wasm:0x64b257
$func60636 @ dotnet.native.wasm:0xc227a2
$func22232 @ dotnet.native.wasm:0x618aba
$func57147 @ dotnet.native.wasm:0xba9313
$func2660 @ dotnet.native.wasm:0xd192c
$func60634 @ dotnet.native.wasm:0xc226a9
$func22494 @ dotnet.native.wasm:0x64b1cd
$func60635 @ dotnet.native.wasm:0xc22788
$func272 @ dotnet.native.wasm:0x72692
$func17491 @ dotnet.native.wasm:0x500279
$do_jit_call_indirect @ c7cbb3c6:0x56
$func11212 @ dotnet.native.wasm:0x3061d6
$func4970 @ dotnet.native.wasm:0x15b290
$func699 @ dotnet.native.wasm:0x802bf
$func55407 @ dotnet.native.wasm:0xb5ac45
$func4698 @ dotnet.native.wasm:0x141026
$func22288 @ dotnet.native.wasm:0x61bcb1
$func8159 @ dotnet.native.wasm:0x23502c
$func19344 @ dotnet.native.wasm:0x574d63
$func5132 @ dotnet.native.wasm:0x172389
$func4395 @ dotnet.native.wasm:0x130c1f
$func19404 @ dotnet.native.wasm:0x578756
$func58823 @ dotnet.native.wasm:0xbd26f5
$func69895 @ dotnet.native.wasm:0xdb03fd
$func69439 @ dotnet.native.wasm:0xd976a7
$func69858 @ dotnet.native.wasm:0xdae599
$func1186 @ dotnet.native.wasm:0x90815
$func17491 @ dotnet.native.wasm:0x500279
$do_jit_call_indirect @ c7cbb3c6:0x56
$func11212 @ dotnet.native.wasm:0x3061d6
$func4970 @ dotnet.native.wasm:0x15b366
$func55333 @ dotnet.native.wasm:0xb58f70
$func55054 @ dotnet.native.wasm:0xb51406
$func11210 @ dotnet.native.wasm:0x305c74
$func2617 @ dotnet.native.wasm:0xcf49e
$func10629 @ dotnet.native.wasm:0x2dee35
$Yb @ dotnet.native.wasm:0xb4cfb1
Module._mono_wasm_invoke_method_bound @ dotnet.native.8.0.0.yeegl3ehmw.js:8
kr @ dotnet.runtime.8.0.0.14kkjimq5k.js:3
l.javaScriptExports.complete_task @ dotnet.runtime.8.0.0.14kkjimq5k.js:3
(anonymous) @ dotnet.runtime.8.0.0.14kkjimq5k.js:3
Promise.then (async)
mo @ dotnet.runtime.8.0.0.14kkjimq5k.js:3
(anonymous) @ dotnet.runtime.8.0.0.14kkjimq5k.js:3
(anonymous) @ dotnet.runtime.8.0.0.14kkjimq5k.js:3
Ul @ dotnet.runtime.8.0.0.14kkjimq5k.js:3
$func64254 @ dotnet.native.wasm:0xc9f023
$func37139 @ dotnet.native.wasm:0x96a0c8
$func37138 @ dotnet.native.wasm:0x969b82
$func60671 @ dotnet.native.wasm:0xc23212
$func88785 @ dotnet.native.wasm:0x11b1021
$func37122 @ dotnet.native.wasm:0x96690f
$func60671 @ dotnet.native.wasm:0xc23212
$func37125 @ dotnet.native.wasm:0x9681a4
$func88770 @ dotnet.native.wasm:0x11b05a4
$func83093 @ dotnet.native.wasm:0x1076550
$func60670 @ dotnet.native.wasm:0xc22f1a
$func3759 @ dotnet.native.wasm:0x10f3e6
$func20148 @ dotnet.native.wasm:0x594757
$func34739 @ dotnet.native.wasm:0x8f65bf
$func1125 @ dotnet.native.wasm:0x8e4e8
$func17491 @ dotnet.native.wasm:0x50028c
$do_jit_call_indirect @ c7cbb3c6:0x56
$func11212 @ dotnet.native.wasm:0x3061d6
$func4970 @ dotnet.native.wasm:0x15b366
$func55333 @ dotnet.native.wasm:0xb58f70
$func55054 @ dotnet.native.wasm:0xb51406
$func11210 @ dotnet.native.wasm:0x305c74
$func1337 @ dotnet.native.wasm:0x96b6d
$func16539 @ dotnet.native.wasm:0x4c9232
$func9194 @ dotnet.native.wasm:0x26df91
$func60890 @ dotnet.native.wasm:0xc2b424
$func57154 @ dotnet.native.wasm:0xba988e
$func11691 @ dotnet.native.wasm:0x322dd3
$func11688 @ dotnet.native.wasm:0x322158
$func60804 @ dotnet.native.wasm:0xc28995
$func60885 @ dotnet.native.wasm:0xc2afe4
$func69859 @ dotnet.native.wasm:0xdaebb6
$func1186 @ dotnet.native.wasm:0x90815
$func17491 @ dotnet.native.wasm:0x500279
$do_jit_call_indirect @ c7cbb3c6:0x56
$func11212 @ dotnet.native.wasm:0x3061d6
$func4970 @ dotnet.native.wasm:0x15b366
$func55333 @ dotnet.native.wasm:0xb58f70
$func55054 @ dotnet.native.wasm:0xb51406
$func11210 @ dotnet.native.wasm:0x305c74
$func2617 @ dotnet.native.wasm:0xcf49e
$func10629 @ dotnet.native.wasm:0x2dee35
$Yb @ dotnet.native.wasm:0xb4cfb1
Module._mono_wasm_invoke_method_bound @ dotnet.native.8.0.0.yeegl3ehmw.js:8
kr @ dotnet.runtime.8.0.0.14kkjimq5k.js:3
l.javaScriptExports.call_entry_point @ dotnet.runtime.8.0.0.14kkjimq5k.js:3
Nc @ dotnet.runtime.8.0.0.14kkjimq5k.js:3
callEntryPoint @ blazor.webassembly.js:1
hn @ blazor.webassembly.js:1
await in hn (async)
mn @ blazor.webassembly.js:1
Cn @ blazor.webassembly.js:1
_0x45e1b4.<computed> @ index.js:1

.NET Version

8.0.100

Anything else?

Version details Chrome version on both Win 10 and 11 Version 120.0.6099.71 (Official Build) (64-bit) ASP.NET 8.0.0 Microsoft Visual Studio Professional 2022 Version 17.8.3 VisualStudio.17.Release/17.8.3+34330.188 Microsoft .NET Framework Version 4.8.09037 Installed Version: Professional Visual C++ 2022 00483-00100-23601-AA172 Microsoft Visual C++ 2022 ASP.NET and Web Tools 17.8.358.6298 ASP.NET and Web Tools C# Tools 4.8.0-7.23572.1+7b75981cf3bd520b86ec4ed00ec156c8bc48e4eb C# components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used. Microsoft JVM Debugger 1.0 Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines Mono Debugging for Visual Studio 17.8.17 (957fbed) Support for debugging Mono processes with Visual Studio. NuGet Package Manager 6.8.0 NuGet Package Manager in Visual Studio. For more information about NuGet, visit https://docs.nuget.org/ Razor (ASP.NET Core) 17.8.3.2358002+8c7fb27bf8e8d4f9ff8080b624b35bca5e812e97 Provides languages services for ASP.NET Core Razor. .NET SDK: Version: 8.0.100 Commit: 57efcf1350 Workload version: 8.0.100-manifests.8d38d0cc Runtime Environment: OS Name: Windows OS Version: 10.0.22000 OS Platform: Windows RID: win-x64 Base Path: C:\Program Files\dotnet\sdk\8.0.100\ .NET workloads installed: Workload version: 8.0.100-manifests.8d38d0cc [wasm-tools-net7] Installation Source: VS 17.8.34330.188 Manifest Version: 8.0.0/8.0.100 Manifest Path: C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.workload.mono.toolchain.net7\8.0.0\WorkloadManifest.json Install Type: Msi [maccatalyst] Installation Source: VS 17.8.34330.188 Manifest Version: 17.0.8478/8.0.100 Manifest Path: C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.sdk.maccatalyst\17.0.8478\WorkloadManifest.json Install Type: Msi [ios] Installation Source: VS 17.8.34330.188 Manifest Version: 17.0.8478/8.0.100 Manifest Path: C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.sdk.ios\17.0.8478\WorkloadManifest.json Install Type: Msi [android] Installation Source: VS 17.8.34330.188 Manifest Version: 34.0.43/8.0.100 Manifest Path: C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.sdk.android\34.0.43\WorkloadManifest.json Install Type: Msi [maui-windows] Installation Source: VS 17.8.34330.188 Manifest Version: 8.0.3/8.0.100 Manifest Path: C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.sdk.maui\8.0.3\WorkloadManifest.json Install Type: Msi [wasm-tools] Installation Source: VS 17.8.34330.188 Manifest Version: 8.0.0/8.0.100 Manifest Path: C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.workload.mono.toolchain.current\8.0.0\WorkloadManifest.json Install Type: Msi Host: Version: 8.0.0 Architecture: x64 Commit: 5535e31a71 .NET SDKs installed: 1.1.0 [C:\Program Files\dotnet\sdk] 2.0.2 [C:\Program Files\dotnet\sdk] 2.1.4 [C:\Program Files\dotnet\sdk] 2.1.101 [C:\Program Files\dotnet\sdk] 2.1.102 [C:\Program Files\dotnet\sdk] 2.1.104 [C:\Program Files\dotnet\sdk] 2.1.200 [C:\Program Files\dotnet\sdk] 2.1.201 [C:\Program Files\dotnet\sdk] 2.1.202 [C:\Program Files\dotnet\sdk] 2.1.526 [C:\Program Files\dotnet\sdk] 2.2.109 [C:\Program Files\dotnet\sdk] 6.0.320 [C:\Program Files\dotnet\sdk] 8.0.100 [C:\Program Files\dotnet\sdk] .NET runtimes installed: Microsoft.AspNetCore.All 2.1.30 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.All 2.2.7 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.App 2.1.30 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 2.2.7 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 6.0.9 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 6.0.25 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 7.0.14 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 8.0.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.NETCore.App 1.0.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 1.1.2 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.0.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.0.6 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.0.7 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.0.9 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.1.30 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.2.7 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 6.0.9 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 6.0.12 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 6.0.25 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 7.0.14 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 8.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.WindowsDesktop.App 6.0.9 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 6.0.25 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 7.0.14 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 8.0.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Other architectures found: x86 [C:\Program Files (x86)\dotnet] registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation] Environment variables: Not set global.json file: Not found Learn more: https://aka.ms/dotnet/info Download .NET: https://aka.ms/dotnet/download
ghost commented 9 months ago

Tagging subscribers to 'arch-wasm': @lewing See info in area-owners.md if you want to be subscribed.

Issue Details
### Is there an existing issue for this? - [X] I have searched the existing issues ### Describe the bug This is a corollary to this same issue that now has a workaround: https://github.com/dotnet/runtime/issues/95322. I'm breaking out a specific lingering problem with Windows 10 here. In the mentioned issue 95322, AOT compilation breaks Blazor if it utilizes LazyLoaded references. This came about because in 8.0.0, now the WasmDedup setting in the csproj is set to true by default (historically was false). By inserting `false ` into the csproj, the Blazor app loads and works as expected; but only on my Windows 11 VM on my development laptop. I then tested the Blazor app on my Windows 10 sanity VM on my server, and it continues to exhibit breaking problems, which is quite strange given the following: - The same IIS server is employed so the same code is delivered to both win 10 and 11's browsers. - Full browser cache clearance made no difference (chrome://settings/clearBrowserData, advanced, all time, all checks) - Same versions (latest) of Chrome being used on both OS's - Version 120.0.6099.71 (Official Build) (64-bit) - Works perfectly in win 10 if Blazor app is published with AOT: false. I hope this sufficiently isolates the issue to AOT:true and Windows 10. The specs for the Win 10 machine: ``` (Edition Windows 10 Pro Version 22H2 Installed on ‎6/‎13/‎2022 OS build 19045.3693 Experience Windows Feature Experience Pack 1000.19053.1000.0) ``` ### Expected Behavior Expect Blazor to work ubiquitously or nowhere, given the same published code and Chrome version. To have OS or possibly hardware distinctions that break the app, seems difficult to mitigate or predict. ### Steps To Reproduce Unfortunately I do not have the time resources necessary to carve out this issue ### Exceptions (if any) ``` dotnet.runtime.8.0.0.14kkjimq5k.js:3 [MONO] DllImport error loading library '__Internal': ''. dotnet.runtime.8.0.0.14kkjimq5k.js:3 [MONO] DllImport error loading library '__Internal': ''. dotnet.runtime.8.0.0.14kkjimq5k.js:3 Uncaught (in promise) at Microsoft.AspNetCore.Components.WebAssembly.Services.DefaultWebAssemblyJSRuntime.__Wrapper_EndInvokeJS_15588484(JSMarshalerArgument* __arguments_buffer) Error: EndOfStringNotFound LineNumber: 0 | BytePositionInLine: 38. at Jn (https://mytesturl/_framework/dotnet.runtime.8.0.0.14kkjimq5k.js:3:31614) at kr (https://mytesturl/_framework/dotnet.runtime.8.0.0.14kkjimq5k.js:3:35529) at Object. (https://mytesturl/_framework/dotnet.runtime.8.0.0.14kkjimq5k.js:3:179811) at Object.endInvokeJSFromDotNet (https://mytesturl/_framework/blazor.webassembly.js:1:44925) at https://mytesturl/_framework/blazor.webassembly.js:1:2967 Jn @ dotnet.runtime.8.0.0.14kkjimq5k.js:3 kr @ dotnet.runtime.8.0.0.14kkjimq5k.js:3 (anonymous) @ dotnet.runtime.8.0.0.14kkjimq5k.js:3 endInvokeJSFromDotNet @ blazor.webassembly.js:1 (anonymous) @ blazor.webassembly.js:1 Promise.then (async) beginInvokeJSFromDotNet @ blazor.webassembly.js:1 bn @ blazor.webassembly.js:1 (anonymous) @ dotnet.runtime.8.0.0.14kkjimq5k.js:3 Ul @ dotnet.runtime.8.0.0.14kkjimq5k.js:3 $func64254 @ dotnet.native.wasm:0xc9f023 $func69911 @ dotnet.native.wasm:0xdb0ea5 $func9630 @ dotnet.native.wasm:0x28a0c6 $func17491 @ dotnet.native.wasm:0x50028c $do_jit_call_indirect @ c7cbb3c6:0x56 $func11212 @ dotnet.native.wasm:0x3061d6 $func4970 @ dotnet.native.wasm:0x15b366 $func699 @ dotnet.native.wasm:0x802bf $func55423 @ dotnet.native.wasm:0xb5b287 $func83132 @ dotnet.native.wasm:0x10783cd $func84004 @ dotnet.native.wasm:0x10a8c1a $func35064 @ dotnet.native.wasm:0x903931 $func60671 @ dotnet.native.wasm:0xc23212 $func3760 @ dotnet.native.wasm:0x10f429 $func20140 @ dotnet.native.wasm:0x594437 $func84003 @ dotnet.native.wasm:0x10a85b6 $func84002 @ dotnet.native.wasm:0x10a842a $func84006 @ dotnet.native.wasm:0x10a8ea1 $func83081 @ dotnet.native.wasm:0x1072eb5 $func60670 @ dotnet.native.wasm:0xc22f1a $func3759 @ dotnet.native.wasm:0x10f3e6 $func20148 @ dotnet.native.wasm:0x594757 $func83084 @ dotnet.native.wasm:0x10753b0 $func37773 @ dotnet.native.wasm:0x9901f7 $func60671 @ dotnet.native.wasm:0xc23212 $func37776 @ dotnet.native.wasm:0x9909ed $func90237 @ dotnet.native.wasm:0x11fabb1 $func14207 @ dotnet.native.wasm:0x3e23f0 $func9580 @ dotnet.native.wasm:0x28765f $func37624 @ dotnet.native.wasm:0x981b58 $func60671 @ dotnet.native.wasm:0xc23212 $func90089 @ dotnet.native.wasm:0x11f395f $func37115 @ dotnet.native.wasm:0x9658f2 $func37120 @ dotnet.native.wasm:0x966219 $func60671 @ dotnet.native.wasm:0xc23212 $func88768 @ dotnet.native.wasm:0x11b051e $func87855 @ dotnet.native.wasm:0x117fe8b $func37143 @ dotnet.native.wasm:0x96a7c3 $func37122 @ dotnet.native.wasm:0x967477 $func22495 @ dotnet.native.wasm:0x64b257 $func60636 @ dotnet.native.wasm:0xc227a2 $func22232 @ dotnet.native.wasm:0x618aba $func57147 @ dotnet.native.wasm:0xba9313 $func2660 @ dotnet.native.wasm:0xd192c $func60634 @ dotnet.native.wasm:0xc226a9 $func22494 @ dotnet.native.wasm:0x64b1cd $func60635 @ dotnet.native.wasm:0xc22788 $func272 @ dotnet.native.wasm:0x72692 $func17491 @ dotnet.native.wasm:0x500279 $do_jit_call_indirect @ c7cbb3c6:0x56 $func11212 @ dotnet.native.wasm:0x3061d6 $func4970 @ dotnet.native.wasm:0x15b290 $func699 @ dotnet.native.wasm:0x802bf $func55407 @ dotnet.native.wasm:0xb5ac45 $func4698 @ dotnet.native.wasm:0x141026 $func22288 @ dotnet.native.wasm:0x61bcb1 $func8159 @ dotnet.native.wasm:0x23502c $func19344 @ dotnet.native.wasm:0x574d63 $func5132 @ dotnet.native.wasm:0x172389 $func3237 @ dotnet.native.wasm:0xf2167 $func6379 @ dotnet.native.wasm:0x1b6e5c $func22476 @ dotnet.native.wasm:0x649e1c $func3688 @ dotnet.native.wasm:0x10ac8d $func37138 @ dotnet.native.wasm:0x969c96 $func22495 @ dotnet.native.wasm:0x64b257 $func60636 @ dotnet.native.wasm:0xc227a2 $func22232 @ dotnet.native.wasm:0x618aba $func57147 @ dotnet.native.wasm:0xba9313 $func2660 @ dotnet.native.wasm:0xd192c $func60634 @ dotnet.native.wasm:0xc226a9 $func22494 @ dotnet.native.wasm:0x64b1cd $func60635 @ dotnet.native.wasm:0xc22788 $func272 @ dotnet.native.wasm:0x72692 $func17491 @ dotnet.native.wasm:0x500279 $do_jit_call_indirect @ c7cbb3c6:0x56 $func11212 @ dotnet.native.wasm:0x3061d6 $func4970 @ dotnet.native.wasm:0x15b290 $func699 @ dotnet.native.wasm:0x802bf $func55407 @ dotnet.native.wasm:0xb5ac45 $func4698 @ dotnet.native.wasm:0x141026 $func22288 @ dotnet.native.wasm:0x61bcb1 $func8159 @ dotnet.native.wasm:0x23502c $func19344 @ dotnet.native.wasm:0x574d63 $func5132 @ dotnet.native.wasm:0x172389 $func4395 @ dotnet.native.wasm:0x130c1f $func19404 @ dotnet.native.wasm:0x578756 $func58823 @ dotnet.native.wasm:0xbd26f5 $func69895 @ dotnet.native.wasm:0xdb03fd $func69439 @ dotnet.native.wasm:0xd976a7 $func69858 @ dotnet.native.wasm:0xdae599 $func1186 @ dotnet.native.wasm:0x90815 $func17491 @ dotnet.native.wasm:0x500279 $do_jit_call_indirect @ c7cbb3c6:0x56 $func11212 @ dotnet.native.wasm:0x3061d6 $func4970 @ dotnet.native.wasm:0x15b366 $func55333 @ dotnet.native.wasm:0xb58f70 $func55054 @ dotnet.native.wasm:0xb51406 $func11210 @ dotnet.native.wasm:0x305c74 $func2617 @ dotnet.native.wasm:0xcf49e $func10629 @ dotnet.native.wasm:0x2dee35 $Yb @ dotnet.native.wasm:0xb4cfb1 Module._mono_wasm_invoke_method_bound @ dotnet.native.8.0.0.yeegl3ehmw.js:8 kr @ dotnet.runtime.8.0.0.14kkjimq5k.js:3 l.javaScriptExports.complete_task @ dotnet.runtime.8.0.0.14kkjimq5k.js:3 (anonymous) @ dotnet.runtime.8.0.0.14kkjimq5k.js:3 Promise.then (async) mo @ dotnet.runtime.8.0.0.14kkjimq5k.js:3 (anonymous) @ dotnet.runtime.8.0.0.14kkjimq5k.js:3 (anonymous) @ dotnet.runtime.8.0.0.14kkjimq5k.js:3 Ul @ dotnet.runtime.8.0.0.14kkjimq5k.js:3 $func64254 @ dotnet.native.wasm:0xc9f023 $func37139 @ dotnet.native.wasm:0x96a0c8 $func37138 @ dotnet.native.wasm:0x969b82 $func60671 @ dotnet.native.wasm:0xc23212 $func88785 @ dotnet.native.wasm:0x11b1021 $func37122 @ dotnet.native.wasm:0x96690f $func60671 @ dotnet.native.wasm:0xc23212 $func37125 @ dotnet.native.wasm:0x9681a4 $func88770 @ dotnet.native.wasm:0x11b05a4 $func83093 @ dotnet.native.wasm:0x1076550 $func60670 @ dotnet.native.wasm:0xc22f1a $func3759 @ dotnet.native.wasm:0x10f3e6 $func20148 @ dotnet.native.wasm:0x594757 $func34739 @ dotnet.native.wasm:0x8f65bf $func1125 @ dotnet.native.wasm:0x8e4e8 $func17491 @ dotnet.native.wasm:0x50028c $do_jit_call_indirect @ c7cbb3c6:0x56 $func11212 @ dotnet.native.wasm:0x3061d6 $func4970 @ dotnet.native.wasm:0x15b366 $func55333 @ dotnet.native.wasm:0xb58f70 $func55054 @ dotnet.native.wasm:0xb51406 $func11210 @ dotnet.native.wasm:0x305c74 $func1337 @ dotnet.native.wasm:0x96b6d $func16539 @ dotnet.native.wasm:0x4c9232 $func9194 @ dotnet.native.wasm:0x26df91 $func60890 @ dotnet.native.wasm:0xc2b424 $func57154 @ dotnet.native.wasm:0xba988e $func11691 @ dotnet.native.wasm:0x322dd3 $func11688 @ dotnet.native.wasm:0x322158 $func60804 @ dotnet.native.wasm:0xc28995 $func60885 @ dotnet.native.wasm:0xc2afe4 $func69859 @ dotnet.native.wasm:0xdaebb6 $func1186 @ dotnet.native.wasm:0x90815 $func17491 @ dotnet.native.wasm:0x500279 $do_jit_call_indirect @ c7cbb3c6:0x56 $func11212 @ dotnet.native.wasm:0x3061d6 $func4970 @ dotnet.native.wasm:0x15b366 $func55333 @ dotnet.native.wasm:0xb58f70 $func55054 @ dotnet.native.wasm:0xb51406 $func11210 @ dotnet.native.wasm:0x305c74 $func2617 @ dotnet.native.wasm:0xcf49e $func10629 @ dotnet.native.wasm:0x2dee35 $Yb @ dotnet.native.wasm:0xb4cfb1 Module._mono_wasm_invoke_method_bound @ dotnet.native.8.0.0.yeegl3ehmw.js:8 kr @ dotnet.runtime.8.0.0.14kkjimq5k.js:3 l.javaScriptExports.call_entry_point @ dotnet.runtime.8.0.0.14kkjimq5k.js:3 Nc @ dotnet.runtime.8.0.0.14kkjimq5k.js:3 callEntryPoint @ blazor.webassembly.js:1 hn @ blazor.webassembly.js:1 await in hn (async) mn @ blazor.webassembly.js:1 Cn @ blazor.webassembly.js:1 _0x45e1b4. @ index.js:1 ``` ### .NET Version 8.0.100 ### Anything else?
Version details Chrome version on both Win 10 and 11 Version 120.0.6099.71 (Official Build) (64-bit) ASP.NET 8.0.0 Microsoft Visual Studio Professional 2022 Version 17.8.3 VisualStudio.17.Release/17.8.3+34330.188 Microsoft .NET Framework Version 4.8.09037 Installed Version: Professional Visual C++ 2022 00483-00100-23601-AA172 Microsoft Visual C++ 2022 ASP.NET and Web Tools 17.8.358.6298 ASP.NET and Web Tools C# Tools 4.8.0-7.23572.1+7b75981cf3bd520b86ec4ed00ec156c8bc48e4eb C# components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used. Microsoft JVM Debugger 1.0 Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines Mono Debugging for Visual Studio 17.8.17 (957fbed) Support for debugging Mono processes with Visual Studio. NuGet Package Manager 6.8.0 NuGet Package Manager in Visual Studio. For more information about NuGet, visit https://docs.nuget.org/ Razor (ASP.NET Core) 17.8.3.2358002+8c7fb27bf8e8d4f9ff8080b624b35bca5e812e97 Provides languages services for ASP.NET Core Razor. .NET SDK: Version: 8.0.100 Commit: 57efcf1350 Workload version: 8.0.100-manifests.8d38d0cc Runtime Environment: OS Name: Windows OS Version: 10.0.22000 OS Platform: Windows RID: win-x64 Base Path: C:\Program Files\dotnet\sdk\8.0.100\ .NET workloads installed: Workload version: 8.0.100-manifests.8d38d0cc [wasm-tools-net7] Installation Source: VS 17.8.34330.188 Manifest Version: 8.0.0/8.0.100 Manifest Path: C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.workload.mono.toolchain.net7\8.0.0\WorkloadManifest.json Install Type: Msi [maccatalyst] Installation Source: VS 17.8.34330.188 Manifest Version: 17.0.8478/8.0.100 Manifest Path: C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.sdk.maccatalyst\17.0.8478\WorkloadManifest.json Install Type: Msi [ios] Installation Source: VS 17.8.34330.188 Manifest Version: 17.0.8478/8.0.100 Manifest Path: C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.sdk.ios\17.0.8478\WorkloadManifest.json Install Type: Msi [android] Installation Source: VS 17.8.34330.188 Manifest Version: 34.0.43/8.0.100 Manifest Path: C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.sdk.android\34.0.43\WorkloadManifest.json Install Type: Msi [maui-windows] Installation Source: VS 17.8.34330.188 Manifest Version: 8.0.3/8.0.100 Manifest Path: C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.sdk.maui\8.0.3\WorkloadManifest.json Install Type: Msi [wasm-tools] Installation Source: VS 17.8.34330.188 Manifest Version: 8.0.0/8.0.100 Manifest Path: C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.workload.mono.toolchain.current\8.0.0\WorkloadManifest.json Install Type: Msi Host: Version: 8.0.0 Architecture: x64 Commit: 5535e31a71 .NET SDKs installed: 1.1.0 [C:\Program Files\dotnet\sdk] 2.0.2 [C:\Program Files\dotnet\sdk] 2.1.4 [C:\Program Files\dotnet\sdk] 2.1.101 [C:\Program Files\dotnet\sdk] 2.1.102 [C:\Program Files\dotnet\sdk] 2.1.104 [C:\Program Files\dotnet\sdk] 2.1.200 [C:\Program Files\dotnet\sdk] 2.1.201 [C:\Program Files\dotnet\sdk] 2.1.202 [C:\Program Files\dotnet\sdk] 2.1.526 [C:\Program Files\dotnet\sdk] 2.2.109 [C:\Program Files\dotnet\sdk] 6.0.320 [C:\Program Files\dotnet\sdk] 8.0.100 [C:\Program Files\dotnet\sdk] .NET runtimes installed: Microsoft.AspNetCore.All 2.1.30 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.All 2.2.7 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.App 2.1.30 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 2.2.7 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 6.0.9 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 6.0.25 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 7.0.14 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 8.0.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.NETCore.App 1.0.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 1.1.2 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.0.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.0.6 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.0.7 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.0.9 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.1.30 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.2.7 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 6.0.9 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 6.0.12 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 6.0.25 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 7.0.14 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 8.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.WindowsDesktop.App 6.0.9 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 6.0.25 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 7.0.14 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 8.0.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Other architectures found: x86 [C:\Program Files (x86)\dotnet] registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation] Environment variables: Not set global.json file: Not found Learn more: https://aka.ms/dotnet/info Download .NET: https://aka.ms/dotnet/download
Author: Sean4572435243
Assignees: -
Labels: `arch-wasm`, `untriaged`, `needs-area-label`
Milestone: -
Sean4572435243 commented 8 months ago

Same error occurs in aspnetcore 8.0.1 dotnet.runtime.8.0.1.rswtxkdyko.js:3 Blazor with lazy loaded DLLs works in windows 11, not in windows 10

Chrome version Version 120.0.6099.217 (Official Build) (64-bit) in both windows 10 and windows 11 VMS

Not sure if it's the windows version or because the hyper-v host hardware is different. Also, the Windows 11 VM runs on a windows 11 host laptop, the failing windows 10 vm runs on a server 2012 R2 hyper-v host.

Sean4572435243 commented 8 months ago

Latest upgrade of Visual Studio to 17.8.5 didn't help.

Adding OS/hardware info Server 2012 R2 Standard Intel Atom CPU C3850 @ 2.10GHz 64 GB ram

maraf commented 7 months ago

I can't reproduce it locally on a simple blazor app with lazy loading compiled with AOT on Win10. Could you please verify if the issue produces for you if you create a simple repro app? If not, is your app publicly accessible? Or could you extract a minimal repro? Also, does the error occur during startup or when the lazy assembly is loaded and used?

Sean4572435243 commented 7 months ago

Hi Maraf, thanks for following up. I'm working on this exact thing. The problem is it's such a big interconnected app, that it's difficult to dissect and still have a working product. Please allow me some time to try to isolate the issue

Sean4572435243 commented 7 months ago

No relief with 8.0.2

Sean4572435243 commented 7 months ago

I was finally able to create a vanilla project that demonstrates this issue (attached).
SampleCode.zip AOT_wwwroot.zip SampleCode.zip contains the vanilla Hello World Blazor app AOT_wwwroot.zip contains the AOT compiled and published files that sit under wwwroot. You should be able to drop those files in IIS and load it in chrome.

To reiterate, the contents of AOT_wwwroot.zip work fine under windows 11 VM (my development laptop). This suggests to me that the code itself isn't the problem, particularly since it's the default vanilla project. The problem appears to be some combination of these datapoints:

Sean4572435243 commented 6 months ago

No relief with 8.0.3

maraf commented 6 months ago

I still can't reproduce it. I have tried the zip provided, on my Win 10 machine (12yo), also inside of another Win 10 in Hyper-V. I don't have access to Windows Server machine.

But if it is that specific, it seems more like a Chrome bug. Can you try Firefox in your environment?

Sean4572435243 commented 6 months ago

Unfortunately FireFox isn't supported by my app (needs Chromium).

Same problem exhibited by Edge (as expected because it's also Chromium)

Now that you've confirmed it's not related to Hyper-V, do you know if you have TLS hardware support on the host machine where you tested the Windows 10? To me, that would be the smoking gun if you do have TLS.

Sean4572435243 commented 6 months ago

Managed to wire up access to the web server via the host 2012 R2 machine so I could test on bare metal, and same problem, though the version of Chrome is much older because it won't update on 2012 R2 since it's essentially Windows 8. This makes me suspect that it's host OS limitations creeping into the VM, which is what I was trying to avoid by creating the Win10 VM.

In either case of TLS or 2012 R2 being the cause, it may amount to "not supported due to age" rather than a bug, which isn't unacceptable.

maraf commented 6 months ago

do you know if you have TLS hardware support on the host machine where you tested the Windows 10?

I have tested it on CPU Intel(R) Core(TM) i7-3770K CPU @ 3.50GHz. Does it help?

Sean4572435243 commented 6 months ago

Thanks for the info. I've been unfortunately referring to TLS, when I actually meant TPM, which is a motherboard feature. Apologies for the confusion.

Found some time to build out a bunch of VMs to test various scenarios, including testing Chrome on Ubuntu under varied hosts and also installed Server 2012 R2 as a VM on my laptop under a win11 host. The final conclusion is that since the upgrade of Blazor from 7.x to 8.0.x, Blazor will not work reliably on any windows 8 based OS (server 2012 R2 for example, whether host or VM), but more obscurely, nor will any VMs of 'any' OS support Blazor 8.0.x if the host is windows 8 based.

This isn't a an entirely unacceptable scenario, particularly since Google has made it clear that support for Chrome in windows 8 has been discontinued. It's not quite as much of an edge-case as it may appear since 2012 R2 I believe is still actively supported by Microsoft and thus that entire demographic has been eliminated from hosting Blazor, but I imagine this was unavoidable and probably makes more sense to let win8 fade into the sunset rather than handicap Blazor to make it work.

Took a lot of discovery to figure this out. If possible, it would be nice if Blazor could cleanly identify whether it's operating in a win8 environment, or infer the host is Win8, and give appropriate 'unsupported OS or host OS' feedback to the user/developer.

Sean4572435243 commented 6 months ago

If Microsoft wants to consider continuing support for Blazor on server 2012 R2 bare metal or VM, I believe my prior demo app should demonstrate the issue to you.

maraf commented 6 months ago

Thanks for the info. I've been unfortunately referring to TLS, when I actually meant TPM, which is a motherboard feature. Apologies for the confusion.

Then the answer is no.

If possible, it would be nice if Blazor could cleanly identify whether it's operating in a win8 environment, or infer the host is Win8, and give appropriate 'unsupported OS or host OS' feedback to the user/developer.

Since WebAssembly is isolated in the browser, this seems like some kind of bug in Chrome, that it thinks something should work but it doesn't. What changed between .NET 7 and 8 is SIMD, but we check that browser supports it and provide a message when it doesn't. And Chrome 120 support SIMD, but maybe it doesn't work on Win 8? You can try to disable it by setting MSBuild properties WasmEnableSIMD and WasmEnableExceptionHandling to false https://github.com/maraf/dotnet-wasm-nosimd/blob/main/src/NoSIMD/NoSIMD.csproj#L5-L6

@lewing Any ideas?

Sean4572435243 commented 6 months ago

Those two property settings did the trick! But at what cost lol..

What particular Blazor features am I giving up by disabling SIMD? Is SIMD merely a GPU bridge? Or are there C# performance enhancements outside of media playback that benefit from SIMD?

Sean4572435243 commented 6 months ago

I should add that I have zero multimedia elements in my Blazor app. Does Blazor always demand SIMD functionality (unless disabled like you suggested), or is this triggered by specific code? Because if it's possible to dynamically enable disable functionality based on SIMD compatibility, it makes more sense to do that than permanently deprecate SIMD to salvage the Win8 demographic.

maraf commented 6 months ago

If you need to support Win 8 only for development inner loop, you can set properties only for build (unset them for publish) or condition them for Debug configuration.

What particular Blazor features am I giving up by disabling SIMD? Is SIMD merely a GPU bridge? Or are there C# performance enhancements outside of media playback that benefit from SIMD?

More info in https://github.com/dotnet/runtime/blob/main/src/mono/wasm/features.md#simd---single-instruction-multiple-data

Because if it's possible to dynamically enable disable functionality based on SIMD compatibility, it makes more sense to do that than permanently deprecate SIMD to salvage the Win8 demographic.

In .NET 8 we don't have a built-in way to dynamicly switch between SIMD and non-SIMD versions. There is a working customer based solution, which involves building twice and then dynamicaly check on runtime which version to download https://github.com/dotnet/runtime/issues/89302#issuecomment-1935806348. In .NET 9 we are looking at supporting it in the box.

I'm going to close the issue now. Feel free to reopen if you have more questions

Sean4572435243 commented 6 months ago

I was actually hoping to include Win8 as a target demographic, not just for development purposes, but after reading your link about the performance increases on basic functionality, it's a no-brainer to retain SIMD functionality and possibly pursue your dual-build recommendation.

To help those that hit this issue in the future, your link could be updated to also mention lack of compatibility with older OS's such as win8 (server 2012 R2) and older, as bare metal or VM, and especially important to mention how 'any' type of OS VM under these older OS hosts will fail, which is really difficult to troubleshoot. And if possible more informative system errors to the console.

Thanks for all your patience and help through this challenging issue. Much appreciated.

Sean4572435243 commented 6 months ago

As a sidenote, it would be a useful feature to allow both simd and non-simd code to be compiled together (at the cost of size), and blazor would just fail-over to non-simd code when appropriate.

Sean4572435243 commented 6 months ago

Worth noting that setting MSBuild properties WasmEnableSIMD and WasmEnableExceptionHandling to false without AOT=true during publishing, breaks the app

maraf commented 6 months ago

I can't repro it on my sample. Does the compilation break or during runtime? Does it repro on app from template?

Sean4572435243 commented 6 months ago

It breaks during runtime just as blazor.webassembly.js is firing up, but works flawlessly when instead AOT=true during publish.

Couldn't reproduce with a vanilla project either, which is unfortunate because there's little I can do to pare my monster app down to create a sample.

I'm publishing with these parameters -p:BlazorWebAssemblyRuntimeOptions="--no-jiterpreter-simd-enabled --no-jiterpreter-wasm-eh-enabled" -p:WasmEnableSIMD=false -p:WasmEnableExceptionHandling=false

This is the runtime error I get when using the above parameters and AOT=false

blazor.webassembly.js:1 Error: raw cwrap mono_wasm_copy_managed_pointer not found
    at Xa (dotnet.runtime.8.0.3…kvxvq3vc.js:3:82777)
    at Di (dotnet.runtime.8.0.3…vxvq3vc.js:3:116454)
    at dotnet.runtime.8.0.3…vxvq3vc.js:3:158428
    at dotnet.runtime.8.0.3…vxvq3vc.js:3:158551
    at xl (dotnet.runtime.8.0.3…vxvq3vc.js:3:173405)
    at dotnet.native.wasm:0x4e6d5
    at dotnet.native.wasm:0x180fdc
    at dotnet.native.wasm:0x178226
    at dotnet.native.wasm:0xbb9ae
    at dotnet.native.wasm:0x1da25

Removing the publish parameters allows the app to start successfully when AOT=false.

This issue isn't a showstopper for me because I only need to include these publish parameters when publishing with AOT=true, and that seems to work.

maraf commented 6 months ago

@Sean4572435243 Can you please validate that this issue isn't caused by stale http cache? (run the app on different port, anonymous browser window, ...)

Sean4572435243 commented 6 months ago

@Sean4572435243 Can you please validate that this issue isn't caused by stale http cache? (run the app on different port, anonymous browser window, ...)

Yes sir, just confirmed in different browsers (latest edge and chrome), also flushing cache with chrome://settings/clearBrowserData with all advanced settings for all time, on win 11 laptop with SIMD capabilities

Sean4572435243 commented 6 months ago

Should this issue be broken out from this thread perhaps?

maraf commented 6 months ago

Should this issue be broken out from this thread perhaps?

Yes, please

maraf commented 6 months ago

@Sean4572435243 What does dotnet --info print for you? Does the issue persist if you update workload (dotnet workload update or dotnet workload install wasm-tools)?

Sean4572435243 commented 5 months ago

Moved to here https://github.com/dotnet/runtime/issues/100234