Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@ public static string GetRuntimeDirectory()
[Obsolete(Obsoletions.RuntimeEnvironmentMessage, DiagnosticId = Obsoletions.RuntimeEnvironmentDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
public static object GetRuntimeInterfaceAsObject(Guid clsid, Guid riid) => throw new PlatformNotSupportedException();

public static string GetSystemVersion() => typeof(object).Assembly.ImageRuntimeVersion;
public static string GetSystemVersion() => $"v{Environment.Version}";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ public void RuntimeEnvironmentRuntimeDirectory()
[Fact]
public void RuntimeEnvironmentSysVersion()
{
Assert.NotEmpty(RuntimeEnvironment.GetSystemVersion());
// The historical format of this API is "vX.Y.Z", so we validate and retain that.
Assert.Equal($"v{Environment.Version}", RuntimeEnvironment.GetSystemVersion());
}

#pragma warning disable SYSLIB0019 // RuntimeEnvironment members SystemConfigurationFile, GetRuntimeInterfaceAsIntPtr, and GetRuntimeInterfaceAsObject are no longer supported and throw PlatformNotSupportedException.
Expand Down