Skip to content

Commit 0504002

Browse files
committed
Add support for .NET 5 runtime,
1 parent 107abd0 commit 0504002

File tree

5 files changed

+17
-7
lines changed

5 files changed

+17
-7
lines changed

src/DynamicAuthorization.Mvc.Core/DynamicAuthorization.Mvc.Core.csproj

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>netstandard2.0;netcoreapp3.0;netcoreapp3.1</TargetFrameworks>
4+
<TargetFrameworks>netstandard2.0;netcoreapp3.0;netcoreapp3.1;net5.0</TargetFrameworks>
55
</PropertyGroup>
66

77
<PropertyGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
@@ -12,6 +12,15 @@
1212
<DefineConstants>NETCORE3;NETSTANDARD;NETSTANDARD2_1</DefineConstants>
1313
</PropertyGroup>
1414

15+
<PropertyGroup Condition="'$(TargetFramework)' == 'net5.0'">
16+
<DefineConstants>NET5;</DefineConstants>
17+
</PropertyGroup>
18+
19+
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
20+
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="2.2.0" />
21+
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="2.2.0" />
22+
</ItemGroup>
23+
1524
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp3.0'">
1625
<FrameworkReference Include="Microsoft.AspNetCore.App" />
1726
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="3.0.0" />
@@ -22,8 +31,8 @@
2231
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="3.1.0" />
2332
</ItemGroup>
2433

25-
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
26-
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="2.2.0" />
27-
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="2.2.0" />
34+
<ItemGroup Condition="'$(TargetFramework)' == 'net5.0'">
35+
<FrameworkReference Include="Microsoft.AspNetCore.App" />
36+
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="5.0.0" />
2837
</ItemGroup>
2938
</Project>

src/DynamicAuthorization.Mvc.Core/Filters/DynamicAuthorizationFilter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ select role.Id.ToString()
9292
context.Result = new ForbidResult();
9393
}
9494

95-
#if NETCORE3
95+
#if NETCORE3 || NET5
9696

9797
private static bool IsProtectedAction(AuthorizationFilterContext context)
9898
{

src/DynamicAuthorization.Mvc.JsonStore/DynamicAuthorization.Mvc.JsonStore.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>netstandard2.0</TargetFramework>
4+
<TargetFrameworks>netstandard2.0;net5.0</TargetFrameworks>
55
</PropertyGroup>
66

77
<ItemGroup>

src/DynamicAuthorization.Mvc.Ui/Controllers/UserRoleController.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
using System;
1010
using System.Collections.Generic;
1111
using System.ComponentModel;
12+
using System.Linq;
1213
using System.Threading.Tasks;
1314

1415
namespace DynamicAuthorization.Mvc.Ui.Controllers

src/DynamicAuthorization.Mvc.Ui/DynamicAuthorization.Mvc.Ui.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk.Razor">
22

33
<PropertyGroup>
4-
<TargetFramework>netcoreapp3.1</TargetFramework>
4+
<TargetFrameworks>netcoreapp3.1;net5.0</TargetFrameworks>
55
<AddRazorSupportForMvc>true</AddRazorSupportForMvc>
66
<RazorCompileOnBuild>true</RazorCompileOnBuild>
77
</PropertyGroup>

0 commit comments

Comments
 (0)