Skip to content

Commit

Permalink
Add support for .NET 5
Browse files Browse the repository at this point in the history
  • Loading branch information
natemcmaster committed Jan 31, 2021
1 parent c5c487c commit a4b7131
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion src/dotnet-serve/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public void ConfigureServices(IServiceCollection services)
}
#if NETCOREAPP3_1
#if !NETCOREAPP2_1
if (_options.UseBrotli == true)
{
options.Providers.Add<BrotliCompressionProvider>();
Expand Down
4 changes: 2 additions & 2 deletions src/dotnet-serve/dotnet-serve.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>netcoreapp3.1;netcoreapp2.1</TargetFrameworks>
<TargetFrameworks>net5.0;netcoreapp3.1;netcoreapp2.1</TargetFrameworks>
<IsPackable>true</IsPackable>
<PackAsTool>true</PackAsTool>
<AssemblyName>dotnet-serve</AssemblyName>
Expand All @@ -16,7 +16,7 @@
<PackageReference Include="Microsoft.AspNetCore.App" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp3.1'">
<ItemGroup Condition="'$(TargetFramework)' != 'netcoreapp2.1'">
<FrameworkReference Include="Microsoft.AspNetCore.App" />
</ItemGroup>

Expand Down
2 changes: 2 additions & 0 deletions test/dotnet-serve.Tests/DotNetServe.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ private static int s_nextPort
= 9000;
#elif NETCOREAPP3_1
= 10000;
#elif NET5_0
= 11000;
#else
#error Update target frameworks
#endif
Expand Down
2 changes: 1 addition & 1 deletion test/dotnet-serve.Tests/dotnet-serve.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netcoreapp3.1;netcoreapp2.1</TargetFrameworks>
<TargetFrameworks>net5.0;netcoreapp3.1;netcoreapp2.1</TargetFrameworks>
<DefaultItemExcludes>$(DefaultItemExcludes);TestAssets\**\*;TestResults\**\*</DefaultItemExcludes>
<RootNamespace>McMaster.DotNet.Serve.Tests</RootNamespace>
</PropertyGroup>
Expand Down

0 comments on commit a4b7131

Please sign in to comment.