question

avitwito-6481 avatar image
0 Votes"
avitwito-6481 asked Bruce-SqlWork answered

Error BLAZORSDK1001 The project references the ASP.NET Core shared framework, which is not supported by Blazor WebAssembly apps

I started a fresh new blazor wasm project, Compiled and ran it. Untill that point every thing was fine.
I try to add ElectronNET.API nuget package and then got the error described at the post title.

My .csproj

 <Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">
    
   <PropertyGroup>
     <TargetFramework>net5.0</TargetFramework>
   </PropertyGroup>
    
   <ItemGroup>
     <PackageReference Include="ElectronNET.API" Version="13.5.1" />
     <PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="5.0.9" />
     <PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="5.0.9" PrivateAssets="all" />
     <PackageReference Include="System.Net.Http.Json" Version="5.0.0" />
   </ItemGroup>
    
 </Project>

Is it possible that blazor wasm is not suported by electron?

dotnet-aspnet-core-blazor
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

Bruce-SqlWork avatar image
1 Vote"
Bruce-SqlWork answered

Electron does not support WASM apps. The electron net allows an .net 5 application access to the Electron webview window and works as a bridge passing browser events and html to render.

You need to use a blazor server project.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.