DotnetEnvironment is an opinionated package to retrieve information about the current environment an application is running in.
DotnetEnvironment is a static class that can be used to retrieve information like if the application is in development mode:
if (DotnetEnvironment.IsDevelopment)
{
// do stuff
}
Or get a directory where your application can store its log files (cross-platform):
string logDirectory = DotnetEnvironment.GetLogDirectory();
First, install NuGet. Then, install the package by either using dotnet:
> dotnet add package Pseud0R4ndom.DotnetEnvironment
or the package manager console:
PM> Install-Package Pseud0R4ndom.DotnetEnvironment
DotnetEnvironment is Copyright © 2022 Dennis Witt under the MIT license