LocalStorage icon indicating copy to clipboard operation
LocalStorage copied to clipboard

[Bug] .NET 8.0 to .NET 9.0

Open cm3solutions opened this issue 1 year ago • 3 comments

Describe the bug I updated my project from .NET 8.0 to .NET 9.0 and got the following error

ManagedError: Method not found: System.Threading.Tasks.ValueTask`1<!!0> Blazored.LocalStorage.ILocalStorageService.GetItemAsync<!0>(string,System.Threading.CancellationToken) at sn (c:\Users\perrym2\source\repos\pulse-iq\PulseIQ\Server\wwwroot\blazor-coffee_framework\https:\raw.githubusercontent.com\dotnet\runtime\9d5a6a9aa463d6d10b0b0ba6d5982cc82f363dc3\src\mono\browser\runtime\marshal-to-js.ts:420:18) at rn (c:\Users\perrym2\source\repos\pulse-iq\PulseIQ\Server\wwwroot\blazor-coffee_framework\https:\raw.githubusercontent.com\dotnet\runtime\9d5a6a9aa463d6d10b0b0ba6d5982cc82f363dc3\src\mono\browser\runtime\marshal-to-js.ts:290:31) at nn (c:\Users\perrym2\source\repos\pulse-iq\PulseIQ\Server\wwwroot\blazor-coffee_framework\https:\raw.githubusercontent.com\dotnet\runtime\9d5a6a9aa463d6d10b0b0ba6d5982cc82f363dc3\src\mono\browser\runtime\marshal-to-js.ts:277:21) at c:\Users\perrym2\source\repos\pulse-iq\PulseIQ\Server\wwwroot\blazor-coffee_framework\https:\raw.githubusercontent.com\dotnet\runtime\9d5a6a9aa463d6d10b0b0ba6d5982cc82f363dc3\src\mono\browser\runtime\managed-exports.ts:68:19 at Object.Pc [as runMain] (c:\Users\perrym2\source\repos\pulse-iq\PulseIQ\Server\wwwroot\blazor-coffee_framework\https:\raw.githubusercontent.com\dotnet\runtime\9d5a6a9aa463d6d10b0b0ba6d5982cc82f363dc3\src\mono\browser\runtime\run.ts:71:22) at async Object.callEntryPoint (https://localhost:5001/blazor-coffee/_framework/blazor.web.js:1:157759) {superStack: {…}, managed_stack: ' at System.Runtime.CompilerServices.Asy…coffee/_framework/blazor.web.js:1:157759)', stack: , message: 'Method not found: System.Threading.Tasks.Val…>(string,System.Threading.CancellationToken)', Symbol(wasm js_owned_gc_handle): 38}

Additional context Will there be an update for .NET 9.0 anytime soon?

cm3solutions avatar Nov 20 '24 22:11 cm3solutions

I've experienced this too, reverting to .net 8 fixes the issue, can we do anything to help debug the issue?

milkyjoe90 avatar Dec 03 '24 17:12 milkyjoe90

any updates on this?

wstaelens avatar Jan 13 '25 08:01 wstaelens

I was not able to create executable publish builds after the upgrade from .NET 7 to .NET 9. The error messages included

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

So, I already started a bug report here, when I found out, that the issue also persisted after having commented out Blazored.LocalStorage. Instead I created a bug report at dotnet/aspnetcore. I finally solved the problem. Please find the solution here.

PhilippJR avatar Jan 17 '25 10:01 PhilippJR