5

I created a .NET Core Web API and class library with .NET Standard 3.1. But when I try to create Blazor WebAssembly with 3.1, it automatically creates a 2.1 version - as seen here:

enter image description here

This is my Blazor web and .NET Core 3.1 is not listed. I install the 3.1 version again but still not listing. I already have .NET Core 3.1 version on Web API and class library but I don't understand why I can not create Blazor 3.1.

But when can I create blazor server side application as 3.1 but I can't create web assembly as 3.1. Any idea would be great

Thanks

H H
  • 263,252
  • 30
  • 330
  • 514
Cemal
  • 153
  • 2
  • 8
  • 2
    You're confusing the **.NET Core** version (which is currently at **3.1**), and the **.NETStandard** version which is currently in fact at **2.1**. Any library written against **.NETStandard 2.1** is in fact only compatible with **.NET Core** 3.1. See https://www.infoq.com/news/2017/10/dotnet-core-standard-difference/ – marc_s Apr 12 '20 at 11:13
  • Web Assembly must target .NET Standard 2.0. It uses Mono client-side, which is a different framework than .NET Core, and is only compatible with .NET Standard 2.0. – Chris Pratt Apr 13 '20 at 13:51
  • 1
    @Chris Pratt, .NET Standard 2.1 is now the correct version to use – AMG Sep 08 '20 at 18:19

2 Answers2

4

This is OK. This is the latest version of Blazor WebAssembly App: .NETStandard 2.1

A Blazor WebAssembly App, unlike Blazor Server App , runs under the Mono runtime. It is not .Net Core.

Just add the project and try it. Alas, it works ;)

Massimiliano Kraus
  • 3,638
  • 5
  • 27
  • 47
enet
  • 41,195
  • 5
  • 76
  • 113
  • please see .net 5.0 features for blazor => https://devblogs.microsoft.com/aspnet/asp-net-core-updates-in-net-5-preview-8/ – Javad Dehban Sep 29 '20 at 14:41
2

You can use .NET 5 (a unified platform): .NET 5.0.100-rc.1 is now available and supports Blazor client-side WebAssembly and Blazor server-side.

See this example: https://github.com/danroth27/BlazorNet5Samples

.NET 5 takes .NET Core and the best of Mono(.netstandard) to create a single platform that you can use for all your modern .NET code.

See also this link about .NET 5: https://devblogs.microsoft.com/dotnet/introducing-net-5/

Massimiliano Kraus
  • 3,638
  • 5
  • 27
  • 47
Taher Fattahi
  • 951
  • 1
  • 6
  • 14