arman
arman

Reputation: 869

why blazor dotnet core 3.1 webassembly client and shared projects are netstandard 2.1?

created blazor web assembly client and server sides in core3.1, when project created we have 3 related projects,

why two other projects are netstandard2.1? I need a change from netstandard2.1 to core3.1.

why client and shared projects are netstandard2.1 ? can I change to netcore3.1?

Upvotes: 2

Views: 955

Answers (2)

Henk Holterman
Henk Holterman

Reputation: 273244

.net-core 3.x is a superset of .net-standard 2.x .

A server project needs to be .net core because that is what asp.net core requires.

Blazor/Wasm runs on the sub-set .net-standard, and even then it throws NotSuportedException for features unavailable in a Browser. Like a simple File.ReadAllText().

Implementing Blazor in .net-core would require changes in Mono and only lead to more empty promises. It has to fit in the Browser 'sandbox' environment.

I need a change from netstandard2.1 to core3.1.

Explain why (you think) you need that. That is where the real problem is and maybe the solution.

can I change to netcore3.1?

No.

Upvotes: 4

enet
enet

Reputation: 45626

server project => netcoreapp3.1

Server projects are netcoreapp3.1 because they run on the server

client project => netstandard2.1

Client projects are netstandard2.1 because they run on the client (browser) by the mono runtime (mono.wasm), which is .Net, not .Net Core. So you cannot change it from netstandard2.1 to core3.1.

shared project => netstandard2.1

Is shared by both the client project and the server project, so you cannot change to netcore3.1, as the client project can only use netstandard2.1

Hope this helps...

Upvotes: 4

Related Questions