.NET MAUI Environment variable

Viewed 68

Is there a way how to find out that the current environment in .NET MAUI is development ? Because before in my Blazor WASM I did just: builder.HostEnvironment.IsDevelopment()

But in MauiAppBuilder I dont see any environment property.

1 Answers

Well what I usually do for this is I use the if directive

So for instance if I wanna check if wanna set a different value to var in release than in debug I would do something like below :

#if DEBUG
var a = "debug";
#elif RELEASE
var a = "release"
#endif

Good luck hope this helps

Related