Table of Contents

Class DotNetUtils

Namespace
Alternet.UI
Assembly
Alternet.UI.Common.dll

Contains static methods and properties related to the DotNet platform.

public static class DotNetUtils
Inheritance
DotNetUtils

Fields

CmdListRuntimes

Gets dotnet command which lists installed runtimes.

CmdListSdks

Gets dotnet command which lists installed sdks.

DefaultLocationMacOs

Gets the default dotnet location on macOs.

DefaultLocationMacOsArmX64

Gets the default location for the dotnet x64 runtimes on an arm64 macOs.

DefaultLocationUbuntuV1

Gets the default dotnet location on Ubuntu 22.04 (when installed from packages.microsoft.com)

DefaultLocationUbuntuV2

Gets the default dotnet location on Ubuntu 22.04 (when installed from Jammy feed).

DefaultLocationWindows

Gets the default dotnet location on Windows.

DefaultLocationWindowsArmX64

Gets the default location for dotnet the x64 runtimes on an arm64 Windows.

EnvironmentVarDotNetRoot

Gets 'DOTNET_ROOT' environment variable name.

EnvironmentVarDotNetRootX64

Gets 'DOTNET_ROOT_X64' environment variable name.

EnvironmentVarDotNetRootX86v1

Gets 'DOTNET_ROOT(x86)' environment variable name.

EnvironmentVarDotNetRootX86v2

Gets 'DOTNET_ROOT_X86' environment variable name.

RuntimeNameAsp

Gets runtime name for Asp applications.

RuntimeNameNetCore

Gets runtime name for core applications.

RuntimeNameWinDesktop

Gets runtime name for MSW desktop applications.

Properties

CmdListRuntimesResult

Gets result of the "dotnet --list-runtimes" command. Command executed only once and result is cached. In order to reload the result, assign Null to the property.

CmdListSdksResult

Gets result of the "dotnet --list-sdks" command. Command executed only once and result is cached. In order to reload the result, assign Null to the property.

Methods

GetDefaultLocation(bool)

Gets dotnet location. Returns value from the environment variables if they are specified; otherwise returns default dotnet location. Returned value is specific to the OS.

GetDefaultLocationUsingSpecialFolder()

Gets dotnet location using Programs. Returns Null if not found.

GetLocationFromEnvironmentVars()

Gets dotnet location from environment variables.

IsNetCoreRuntimeInstalled(int)

Gets whether the specified dotnet runtime is installed.