Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Blazor WebAssembly 3.1 Target Framework is missing

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

like image 860
Cemal Avatar asked Apr 12 '20 11:04

Cemal


People also ask

What is AOT in Blazor?

Ahead-of-time (AOT) compilation. Blazor WebAssembly supports ahead-of-time (AOT) compilation, where you can compile your . NET code directly into WebAssembly. AOT compilation results in runtime performance improvements at the expense of a larger app size.

Does Blazor work with .NET framework?

Both client and server code is written in C#, allowing you to share code and libraries. Blazor is a feature of ASP.NET, the popular web development framework that extends the . NET developer platform with tools and libraries for building web apps.

Is Blazor worth learning 2021?

If you were considering a Windows desktop application (built on something like WPF), Blazor is a more future-forward choice. But if you're a business building modern, public web applications, there's very little chance you'll recommend a client start with Blazor today.

What is the target framework for Blazor WebAssembly?

Blazor 3.2 WebAssembly projects were compiled to target .NET Standard 2.1 ( <TargetFramework>netstandard2.1</TargetFramework> ). In ASP.NET Core 5.0, both Blazor Server and Blazor WebAssembly projects target .NET 5 ( <TargetFramework>net5.0</TargetFramework> ).

What version of net is used in Blazor?

In Blazor 3.1 and 3.2, packages target .NET Standard 2.1 and .NET Core 3.1. In ASP.NET Core 5.0, packages target .NET 5.0. The change was made to better align with .NET target framework requirements.

Can I use Blazor WebAssembly app with mono?

It uses Mono client-side, which is a different framework than .NET Core, and is only compatible with .NET Standard 2.0. 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.

How do I use npm packages in Blazor WebAssembly?

How do I use NPM packages in Blazor WebAssembly? Create a Blazor WebAssembly application in Visual Studio 2019 using this link. Right-click on the application and create a new folder named npm_packages. Open the npm_packages folder directory via command prompt and run the following command to initialize NPM in the application.


Video Answer


2 Answers

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 ;)

like image 121
enet Avatar answered Oct 30 '22 00:10

enet


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/

like image 34
Taher Fattahi Avatar answered Oct 29 '22 22:10

Taher Fattahi