Skip to content

Proposed additions to RuntimeInformation #20400

Closed
@leecow

Description

@leecow

https://github.com/dotnet/corefx/issues/12737

RuntimeInformation

Rational and Usage

It is often desirable and necessary for applications to determine execution environment and runtime information. Existing information provided by System.Runtime.InteropServices.RuntimeInformation could be enhanced and expanded with additional API to provide robust information.

System.Runtime.InteropServices.RuntimeInformation currently provides surface for some of information though modification to current behavior or addition API may be needed.

Existing API

  • OSPlatform
  • ProcessAchitecture
  • OSArchitecture
  • OSDescription
  • FrameworkDescription
  • IsOSPlatform

Proposed additions

  • OSName - Windows, Mac, Ubuntu, Red Hat Enterprise Linux Server
  • OSVersion - following the previous examples - 10.0.15027, 10.12.3, 16.10, 7.2
  • RuntimeVersions - Runtime version currently used by the application, eg NETCore.App 1.0.4
  • InstalledRuntimeVersions - List of targetable runtime on system

Open Questions

Updates

Appendix

/etc/os-release will have the pertinent information on all systemd-based distros. All distros in our current support set use systemd. Alpine Linux includes /etc/os-release.
Variables can be accessed directly with ( source /etc/os-release && echo "$PRETTY_NAME" )

Fedora:

	NAME=Fedora
	VERSION="24 (Workstation Edition)"
	ID=fedora
	VERSION_ID=24
	PRETTY_NAME="Fedora 24 (Workstation Edition)"
	ANSI_COLOR="0;34"
	CPE_NAME="cpe:/o:fedoraproject:fedora:24"
	HOME_URL="https://fedoraproject.org/"
	BUG_REPORT_URL="https://bugzilla.redhat.com/"
	REDHAT_BUGZILLA_PRODUCT="Fedora"
	REDHAT_BUGZILLA_PRODUCT_VERSION=24
	REDHAT_SUPPORT_PRODUCT="Fedora"
	REDHAT_SUPPORT_PRODUCT_VERSION=24
	PRIVACY_POLICY_URL=https://fedoraproject.org/wiki/Legal:PrivacyPolicy
	VARIANT="Workstation Edition"
	VARIANT_ID=workstation

Alpine:

	NAME="Alpine Linux"
	ID=alpine
	VERSION_ID=3.5.0
	PRETTY_NAME="Alpine Linux v3.5"
	HOME_URL="http://alpinelinux.org"
	BUG_REPORT_URL="http://bugs.alpinelinux.org"

/cc @richlander , @mellinoe , @Petermarcu , @AlexGhiondea , @weshaggard , @danmosemsft

Metadata

Metadata

Assignees

No one assigned

    Labels

    api-needs-workAPI needs work before it is approved, it is NOT ready for implementationarea-System.Runtime

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions