Quantcast
Channel: Active questions tagged blazor - Stack Overflow
Viewing all articles
Browse latest Browse all 4839

How to check programmatically is application been exeuted via Browser or executed as native application in "Blazor Hybrid and Web App"-type projects?

$
0
0

From the .NET 9, the .NET MAUI Blazor Hybrid and Web App"-type project is available.

enter image description here

It has the shared code for both Web and native platform.But how to check programmatically is application been run via Browser as web app, or is being executed as native application? It should be something like:

// WARINING: It is NOT the actual APIif (Runtime.IsWeb()) {  System.Diagnostics.Debug.WriteLine("Running via web. The files management is not available");}if (Runtime.IsNative()) {  System.Diagnostics.Debug.WriteLine("Running as native app. The files management is available");}

Viewing all articles
Browse latest Browse all 4839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>