From a8bd859397041cb026fd1c80664b26d7cf50a635 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Thu, 29 Oct 2020 10:54:09 +0800 Subject: [PATCH] use System.Environment.OSVersion in .net standard (#7831) --- .../src/main/resources/csharp-netcore/Configuration.mustache | 5 ----- .../src/Org.OpenAPITools/Client/Configuration.cs | 3 ++- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/Configuration.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/Configuration.mustache index f5fc29683dde..718db517d4ef 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/Configuration.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/Configuration.mustache @@ -499,13 +499,8 @@ namespace {{packageName}}.Client public static String ToDebugReport() { String report = "C# SDK ({{{packageName}}}) Debug Report:\n"; - {{^netStandard}} report += " OS: " + System.Environment.OSVersion + "\n"; report += " .NET Framework Version: " + System.Environment.Version + "\n"; - {{/netStandard}} - {{#netStandard}} - report += " OS: " + System.Runtime.InteropServices.RuntimeInformation.OSDescription + "\n"; - {{/netStandard}} report += " Version of the API: {{{version}}}\n"; report += " SDK Package Version: {{{packageVersion}}}\n"; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Client/Configuration.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Client/Configuration.cs index 279cfe96b744..bca7db624cd8 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Client/Configuration.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Client/Configuration.cs @@ -514,7 +514,8 @@ public HttpSigningConfiguration HttpSigningConfiguration public static String ToDebugReport() { String report = "C# SDK (Org.OpenAPITools) Debug Report:\n"; - report += " OS: " + System.Runtime.InteropServices.RuntimeInformation.OSDescription + "\n"; + report += " OS: " + System.Environment.OSVersion + "\n"; + report += " .NET Framework Version: " + System.Environment.Version + "\n"; report += " Version of the API: 1.0.0\n"; report += " SDK Package Version: 1.0.0\n";