Enrico
Enrico

Reputation: 6246

NET8 with Blazor has an error reading 'dotnet.wasm'

I tried to convert my Blazor project from NET7 to NET8 because I'm facing some issues with the integrity check. I installed NET8 RC and Visual Studio 17.8 Preview.

My solution consists of the server project that hosts the Blazor WebAssembly.

After the conversion, I run the application and I get this error.

Error: Failed to start platform. Reason: TypeError: Cannot read properties of undefined (reading 'dotnet.wasm')

enter image description here

Upvotes: 8

Views: 6840

Answers (4)

Gleb S
Gleb S

Reputation: 172

Got the same error some time after upgrading. But everything worked the day before (after upgrade ofc), so it wasn't a package problem.

I believe browser cached some libs when I was working with old brach, so it didn't let me run actual brunch properly.

Fixed by CTRL+F5

Upvotes: 0

nammadhu
nammadhu

Reputation: 1

be Simple... Just update to .net 8(from 6/7/any) then manage nuget packages and then update all to lastest probably like 8.0.5 within a minute all fixed... enjoy... nothing else required... enter image description here

Upvotes: 0

Flavio Sampaio
Flavio Sampaio

Reputation: 21

I just start work with .NET8 (VS2022 - V: 17.8.3) and I did face the same issue. I did create an BlazorWasm Standalone app, and I did set to .NET 7 by mistake. Then I got the error you facing. So, I close the solution and create a new one, this time set to .NET 8. Copy all my files and folder from the first solution and all works just fine.

The error is gone.

So, Just change the project from .NET 7 to .NET 8 does note solve the problem, I believe we need more than that.

Upvotes: 1

II ARROWS
II ARROWS

Reputation: 518

I've solved it by manually checking NuGets packages, because in the upgrade guides they tell you just need to change "net7.0" to "net8.0" in the projects, but in reality you also have to upgrade NuGet packages like "Microsoft.AspNetCore.Components.WebAssembly" which are prerelease right now.

The usual suggestion of closing Visual Studio and delete all the /bin and /obj folders won't hurt, but I'm not sure it's necessary. On its own it didn't work for me.

Upvotes: 15

Related Questions