From 7eba100abfde507f5e689774455767405be70b71 Mon Sep 17 00:00:00 2001 From: Frank Wagner Date: Wed, 5 May 2021 23:46:22 +0200 Subject: [PATCH] aspnet example with net472 (#65) --- YaNco.sln | 20 ++++++++++++- samples/WebApi.Shared/RfcLibraryHelper.cs | 2 +- samples/WebApi.Shared/WebApi.Shared.csproj | 8 ++++- .../SAPWebAPI/Properties/launchSettings.json | 30 +++++++++++++++++++ samples/net472/SAPWebAPI/SAPWebAPI.csproj | 28 +++++++++++++++++ samples/net472/SAPWebAPI/app.config | 6 ++++ .../SAPWebAPI/appsettings.Development.json | 9 ++++++ samples/net472/SAPWebAPI/appsettings.json | 8 +++++ samples/netcore2.1/SAPWebAPI/Program.cs | 8 ----- samples/netcore2.1/SAPWebAPI/Startup.cs | 7 ----- 10 files changed, 108 insertions(+), 18 deletions(-) create mode 100644 samples/net472/SAPWebAPI/Properties/launchSettings.json create mode 100644 samples/net472/SAPWebAPI/SAPWebAPI.csproj create mode 100644 samples/net472/SAPWebAPI/app.config create mode 100644 samples/net472/SAPWebAPI/appsettings.Development.json create mode 100644 samples/net472/SAPWebAPI/appsettings.json diff --git a/YaNco.sln b/YaNco.sln index 21774746..7f642620 100644 --- a/YaNco.sln +++ b/YaNco.sln @@ -31,10 +31,14 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "netcore2.1", "netcore2.1", EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WebApi.Shared", "samples\WebApi.Shared\WebApi.Shared.csproj", "{BAFF7A74-DB10-45D9-A3CB-827239599D88}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SAPWebAPI", "samples\netcore2.1\SAPWebAPI\SAPWebAPI.csproj", "{89240742-3F31-4BA5-89A6-81C0CA6AE451}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SAPWebAPI", "samples\netcore2.1\SAPWebAPI\SAPWebAPI.csproj", "{89240742-3F31-4BA5-89A6-81C0CA6AE451}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SAPWebAPI", "samples\netcore3.1\SAPWebAPI\SAPWebAPI.csproj", "{90FDEB6C-05A9-45FF-A566-0230CA724235}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "net472", "net472", "{0B7CE0F5-179E-41BA-BBAC-5E9001550E43}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SAPWebAPI", "samples\net472\SAPWebAPI\SAPWebAPI.csproj", "{427D3A36-64DA-42F7-B406-95B7078F50EB}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -151,6 +155,18 @@ Global {90FDEB6C-05A9-45FF-A566-0230CA724235}.Release|x64.Build.0 = Release|Any CPU {90FDEB6C-05A9-45FF-A566-0230CA724235}.Release|x86.ActiveCfg = Release|Any CPU {90FDEB6C-05A9-45FF-A566-0230CA724235}.Release|x86.Build.0 = Release|Any CPU + {427D3A36-64DA-42F7-B406-95B7078F50EB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {427D3A36-64DA-42F7-B406-95B7078F50EB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {427D3A36-64DA-42F7-B406-95B7078F50EB}.Debug|x64.ActiveCfg = Debug|Any CPU + {427D3A36-64DA-42F7-B406-95B7078F50EB}.Debug|x64.Build.0 = Debug|Any CPU + {427D3A36-64DA-42F7-B406-95B7078F50EB}.Debug|x86.ActiveCfg = Debug|Any CPU + {427D3A36-64DA-42F7-B406-95B7078F50EB}.Debug|x86.Build.0 = Debug|Any CPU + {427D3A36-64DA-42F7-B406-95B7078F50EB}.Release|Any CPU.ActiveCfg = Release|Any CPU + {427D3A36-64DA-42F7-B406-95B7078F50EB}.Release|Any CPU.Build.0 = Release|Any CPU + {427D3A36-64DA-42F7-B406-95B7078F50EB}.Release|x64.ActiveCfg = Release|Any CPU + {427D3A36-64DA-42F7-B406-95B7078F50EB}.Release|x64.Build.0 = Release|Any CPU + {427D3A36-64DA-42F7-B406-95B7078F50EB}.Release|x86.ActiveCfg = Release|Any CPU + {427D3A36-64DA-42F7-B406-95B7078F50EB}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -161,6 +177,8 @@ Global {BAFF7A74-DB10-45D9-A3CB-827239599D88} = {D81DD87D-D96B-4A06-B360-B71BED6E5199} {89240742-3F31-4BA5-89A6-81C0CA6AE451} = {8534BBA2-FF98-4D0F-AE60-3EAFADB69653} {90FDEB6C-05A9-45FF-A566-0230CA724235} = {BEE8F8E1-8859-4A61-B668-5467423911D7} + {0B7CE0F5-179E-41BA-BBAC-5E9001550E43} = {D81DD87D-D96B-4A06-B360-B71BED6E5199} + {427D3A36-64DA-42F7-B406-95B7078F50EB} = {0B7CE0F5-179E-41BA-BBAC-5E9001550E43} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {C3AB2171-471F-4842-A039-4CE0AC4FBB45} diff --git a/samples/WebApi.Shared/RfcLibraryHelper.cs b/samples/WebApi.Shared/RfcLibraryHelper.cs index c2c79bd6..0ccc14f5 100644 --- a/samples/WebApi.Shared/RfcLibraryHelper.cs +++ b/samples/WebApi.Shared/RfcLibraryHelper.cs @@ -26,7 +26,7 @@ public static void EnsurePathVariable() if (currentPathVariable.Contains(executeableDir)) return; - if (!currentPathVariable.EndsWith(';')) + if (!currentPathVariable.EndsWith(";")) currentPathVariable += ';'; } diff --git a/samples/WebApi.Shared/WebApi.Shared.csproj b/samples/WebApi.Shared/WebApi.Shared.csproj index 118bb45e..21d1c4c8 100644 --- a/samples/WebApi.Shared/WebApi.Shared.csproj +++ b/samples/WebApi.Shared/WebApi.Shared.csproj @@ -1,7 +1,7 @@  - netcoreapp2.1;netcoreapp3.1;net5.0 + net472;netcoreapp2.1;netcoreapp3.1;net5.0 false @@ -22,6 +22,12 @@ + + + + + + diff --git a/samples/net472/SAPWebAPI/Properties/launchSettings.json b/samples/net472/SAPWebAPI/Properties/launchSettings.json new file mode 100644 index 00000000..2defb072 --- /dev/null +++ b/samples/net472/SAPWebAPI/Properties/launchSettings.json @@ -0,0 +1,30 @@ +{ + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:62051", + "sslPort": 44391 + } + }, + "$schema": "http://json.schemastore.org/launchsettings.json", + "profiles": { + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "launchUrl": "api/company", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "SAPWebAPI": { + "commandName": "Project", + "launchBrowser": true, + "launchUrl": "api/company", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + }, + "applicationUrl": "http://localhost:5000" + } + } +} \ No newline at end of file diff --git a/samples/net472/SAPWebAPI/SAPWebAPI.csproj b/samples/net472/SAPWebAPI/SAPWebAPI.csproj new file mode 100644 index 00000000..b81727b8 --- /dev/null +++ b/samples/net472/SAPWebAPI/SAPWebAPI.csproj @@ -0,0 +1,28 @@ + + + + net472 + 577d8ea0-f844-4a6c-a833-a9b0aa7ceb79 + + + + + + + + + + + + + + + + + + + + + + + diff --git a/samples/net472/SAPWebAPI/app.config b/samples/net472/SAPWebAPI/app.config new file mode 100644 index 00000000..a6ad8283 --- /dev/null +++ b/samples/net472/SAPWebAPI/app.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/samples/net472/SAPWebAPI/appsettings.Development.json b/samples/net472/SAPWebAPI/appsettings.Development.json new file mode 100644 index 00000000..e203e940 --- /dev/null +++ b/samples/net472/SAPWebAPI/appsettings.Development.json @@ -0,0 +1,9 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Debug", + "System": "Information", + "Microsoft": "Information" + } + } +} diff --git a/samples/net472/SAPWebAPI/appsettings.json b/samples/net472/SAPWebAPI/appsettings.json new file mode 100644 index 00000000..def9159a --- /dev/null +++ b/samples/net472/SAPWebAPI/appsettings.json @@ -0,0 +1,8 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Warning" + } + }, + "AllowedHosts": "*" +} diff --git a/samples/netcore2.1/SAPWebAPI/Program.cs b/samples/netcore2.1/SAPWebAPI/Program.cs index dd97c112..1a072bc2 100644 --- a/samples/netcore2.1/SAPWebAPI/Program.cs +++ b/samples/netcore2.1/SAPWebAPI/Program.cs @@ -1,13 +1,5 @@ using Microsoft.AspNetCore; using Microsoft.AspNetCore.Hosting; -using Microsoft.Extensions.Configuration; -using Microsoft.Extensions.Logging; -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.IO; -using System.Linq; -using System.Threading.Tasks; using WebApi; namespace SAPWebAPI diff --git a/samples/netcore2.1/SAPWebAPI/Startup.cs b/samples/netcore2.1/SAPWebAPI/Startup.cs index aa9be440..c01642fb 100644 --- a/samples/netcore2.1/SAPWebAPI/Startup.cs +++ b/samples/netcore2.1/SAPWebAPI/Startup.cs @@ -1,15 +1,8 @@ using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; -using Microsoft.AspNetCore.HttpsPolicy; using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Logging; -using Microsoft.Extensions.Options; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; namespace SAPWebAPI {