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

avi twito 21 Reputation points
2021-08-30T14:16:51.77+00:00

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?

Developer technologies | .NET | Blazor
0 comments No comments
{count} votes

Accepted answer
  1. Bruce (SqlWork.com) 78,006 Reputation points Volunteer Moderator
    2021-08-30T14:36:14.43+00:00

    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.

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.