Skip to content

Commit cb09eb3

Browse files
Merge pull request #48 from sucrose0413/master
Support net5.0 as target framework
2 parents c4e1f66 + 8cb3b0b commit cb09eb3

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

src/MakingSense.AspNetCore.HypermediaApi/Formatters/HypermediaApiJsonInputFormatter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
using Microsoft.Extensions.ObjectPool;
77
using Newtonsoft.Json;
88

9-
#if NETCOREAPP3_0 || NETCOREAPP3_1
9+
#if NETCOREAPP3_0 || NETCOREAPP3_1 || NET5_0
1010
using MvcJsonOptions = Microsoft.AspNetCore.Mvc.MvcNewtonsoftJsonOptions;
1111
using JsonInputFormatter = Microsoft.AspNetCore.Mvc.Formatters.NewtonsoftJsonInputFormatter;
1212
#endif

src/MakingSense.AspNetCore.HypermediaApi/Formatters/Internal/HypermediaApiMvcOptionsSetup.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
using Microsoft.Extensions.Options;
88
using Newtonsoft.Json;
99

10-
#if NETCOREAPP3_0 || NETCOREAPP3_1
10+
#if NETCOREAPP3_0 || NETCOREAPP3_1 || NET5_0
1111
using MvcJsonOptions = Microsoft.AspNetCore.Mvc.MvcNewtonsoftJsonOptions;
1212
#endif
1313

@@ -46,7 +46,7 @@ public static void ConfigureMvc(
4646
options.OutputFormatters.Clear();
4747

4848
var jsonOutputFormatter =
49-
#if NETCOREAPP3_0 || NETCOREAPP3_1
49+
#if NETCOREAPP3_0 || NETCOREAPP3_1 || NET5_0
5050
new NewtonsoftJsonOutputFormatter(serializerSettings, charPool, options);
5151
#elif NETSTANDARD2_0
5252
new JsonOutputFormatter(serializerSettings, charPool);

src/MakingSense.AspNetCore.HypermediaApi/MakingSense.AspNetCore.HypermediaApi.csproj

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<PropertyGroup>
44
<Description>MakingSense.AspNetCore.HypermediaApi Class Library</Description>
55
<Authors>MakingSense</Authors>
6-
<TargetFrameworks>netcoreapp3.1;netcoreapp3.0;netstandard2.0</TargetFrameworks>
6+
<TargetFrameworks>net5.0;netcoreapp3.1;netcoreapp3.0;netstandard2.0</TargetFrameworks>
77
<AssemblyName>MakingSense.AspNetCore.HypermediaApi</AssemblyName>
88
<PackageId>MakingSense.AspNetCore.HypermediaApi</PackageId>
99
<PackageTags>ASP.NET 5;vnext;Hypermedia;API;REST;ASP.NET Core</PackageTags>
@@ -19,6 +19,13 @@
1919
<ProjectReference Include="..\MakingSense.AspNetCore.Abstractions\MakingSense.AspNetCore.Abstractions.csproj" />
2020
</ItemGroup>
2121

22+
<ItemGroup Condition="'$(TargetFramework)' == 'net5.0'">
23+
<FrameworkReference Include="Microsoft.AspNetCore.App" />
24+
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson">
25+
<Version>5.0.3</Version>
26+
</PackageReference>
27+
</ItemGroup>
28+
2229
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp3.1'">
2330
<FrameworkReference Include="Microsoft.AspNetCore.App" />
2431
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson">

0 commit comments

Comments
 (0)