Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Detect client or server mode

Tags:

c#

blazor

I am building a Blazor application which can switch between client mode and server mode. Parts of the application work only in one or the other and need to have fallback code executed in that case.

Is there a good way to check for example if Mono is running or not?

Any suggestions?

like image 678
Michael A. Volz aka Flynn Avatar asked Nov 28 '18 09:11

Michael A. Volz aka Flynn


People also ask

Is next js a server?

By default, Next. js includes its own server with next start . If you have an existing backend, you can still use it with Next. js (this is not a custom server).

Is process browser deprecated?

process. browser is deprecated and using typeof window instead will get you in-framework optimizations.


1 Answers

using RuntimeInformation.OSDescription

RuntimeInformation.OSDescription == "web"
like image 63
Simon Avatar answered Sep 20 '22 06:09

Simon