Skip to content

Blazor.Shared projects should be marked as wanting to support 'browser' #25337

@terrajobst

Description

@terrajobst

This applies to the Blazor template that creates Blazor.Server, Blazor.Client, and Blazor.Shared. Blazor.Client uses the Microsoft.NET.Sdk.BlazorWebAssembly and is automatically marked as supporting browser. However, Blazor.Shared is a regular .NET 5 class library which by default assumes that browser isn't supported, thus not generating warnings for APIs unsupported in the browser sandbox.

Expected Behavior

The Blazor.Shared project should look as follows:

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <TargetFramework>net5.0</TargetFramework>
  </PropertyGroup>

  <ItemGroup>
    <SupportedPlatform Include="browser" />
  </ItemGroup>

</Project>

/cc @danroth27 @pranavkm @SteveSandersonMS

Metadata

Metadata

Assignees

Labels

DoneThis issue has been fixedarea-blazorIncludes: Blazor, Razor ComponentsbugThis issue describes a behavior which is not expected - a bug.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions