From a4b7131db7d8ab10e210d53bdb1d7cafc6282c41 Mon Sep 17 00:00:00 2001 From: Nate McMaster Date: Sat, 30 Jan 2021 22:30:05 -0800 Subject: [PATCH] Add support for .NET 5 --- .vscode/launch.json | 2 +- src/dotnet-serve/Startup.cs | 2 +- src/dotnet-serve/dotnet-serve.csproj | 4 ++-- test/dotnet-serve.Tests/DotNetServe.cs | 2 ++ test/dotnet-serve.Tests/dotnet-serve.Tests.csproj | 2 +- 5 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index 70a055f..f4c50a2 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -6,7 +6,7 @@ "type": "coreclr", "request": "launch", "preLaunchTask": "build", - "program": "${workspaceFolder}/.build/bin/dotnet-serve/Debug/netcoreapp3.1/dotnet-serve.dll", + "program": "${workspaceFolder}/.build/bin/dotnet-serve/Debug/net5.0/dotnet-serve.dll", "args": [], "cwd": "${workspaceFolder}/src/dotnet-serve", "console": "internalConsole", diff --git a/src/dotnet-serve/Startup.cs b/src/dotnet-serve/Startup.cs index 517901f..d946a79 100644 --- a/src/dotnet-serve/Startup.cs +++ b/src/dotnet-serve/Startup.cs @@ -56,7 +56,7 @@ public void ConfigureServices(IServiceCollection services) } -#if NETCOREAPP3_1 +#if !NETCOREAPP2_1 if (_options.UseBrotli == true) { options.Providers.Add(); diff --git a/src/dotnet-serve/dotnet-serve.csproj b/src/dotnet-serve/dotnet-serve.csproj index 75c9147..6206f1c 100644 --- a/src/dotnet-serve/dotnet-serve.csproj +++ b/src/dotnet-serve/dotnet-serve.csproj @@ -2,7 +2,7 @@ Exe - netcoreapp3.1;netcoreapp2.1 + net5.0;netcoreapp3.1;netcoreapp2.1 true true dotnet-serve @@ -16,7 +16,7 @@ - + diff --git a/test/dotnet-serve.Tests/DotNetServe.cs b/test/dotnet-serve.Tests/DotNetServe.cs index b3c559c..cac80be 100644 --- a/test/dotnet-serve.Tests/DotNetServe.cs +++ b/test/dotnet-serve.Tests/DotNetServe.cs @@ -21,6 +21,8 @@ private static int s_nextPort = 9000; #elif NETCOREAPP3_1 = 10000; +#elif NET5_0 + = 11000; #else #error Update target frameworks #endif diff --git a/test/dotnet-serve.Tests/dotnet-serve.Tests.csproj b/test/dotnet-serve.Tests/dotnet-serve.Tests.csproj index 351e224..e680cd8 100644 --- a/test/dotnet-serve.Tests/dotnet-serve.Tests.csproj +++ b/test/dotnet-serve.Tests/dotnet-serve.Tests.csproj @@ -1,7 +1,7 @@  - netcoreapp3.1;netcoreapp2.1 + net5.0;netcoreapp3.1;netcoreapp2.1 $(DefaultItemExcludes);TestAssets\**\*;TestResults\**\* McMaster.DotNet.Serve.Tests