Skip to content

Commit ab27110

Browse files
committed
- Added support for .net 5.0
- Fixed #234 Signed-off-by: rpgmaker <olamide.bakre@gmail.com>
1 parent ae68bff commit ab27110

File tree

14 files changed

+456
-11
lines changed

14 files changed

+456
-11
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<TargetFramework>net5.0</TargetFramework>
5+
<AssemblyName>NetJSON</AssemblyName>
6+
<RootNamespace>NetJSON</RootNamespace>
7+
</PropertyGroup>
8+
9+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
10+
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
11+
<DefineConstants>TRACE;NET_5</DefineConstants>
12+
<DocumentationFile>bin\Debug\NetJSON.xml</DocumentationFile>
13+
<OutputPath>bin\Debug\</OutputPath>
14+
</PropertyGroup>
15+
16+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
17+
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
18+
<DefineConstants>TRACE;NET_5</DefineConstants>
19+
<DocumentationFile>bin\Release\NetJSON.xml</DocumentationFile>
20+
<OutputPath>bin\Release\</OutputPath>
21+
</PropertyGroup>
22+
23+
<ItemGroup>
24+
<Compile Include="..\NetJSON\AutomaticTypeConverter.cs" Link="AutomaticTypeConverter.cs" />
25+
<Compile Include="..\NetJSON\IntUtility.cs" Link="IntUtility.cs" />
26+
<Compile Include="..\NetJSON\Models.cs" Link="Models.cs" />
27+
<Compile Include="..\NetJSON\NetJSON.cs" Link="NetJSON.cs" />
28+
<Compile Include="..\NetJSON\NetJSON.Internals.cs" Link="NetJSON.Internals.cs" />
29+
</ItemGroup>
30+
31+
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
32+
<Exec Command="xcopy /y &quot;$(TargetPath)&quot; &quot;$(SolutionDir)NetJSON\lib\net5.0\&quot;&#xD;&#xA;xcopy /y &quot;$(TargetDir)$(TargetName).xml&quot; &quot;$(SolutionDir)NetJSON\lib\net5.0\&quot;" />
33+
</Target>
34+
35+
</Project>

NetJSON.sln

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NetJSON.Standard2_0.Tests",
2828
EndProject
2929
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NetJSON.TestHarness", "NetJSON.TestHarness\NetJSON.TestHarness.csproj", "{A3C27161-165E-4357-9E1C-1A6FB334CF11}"
3030
EndProject
31+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NetJSON.Net5_0", "NetJSON.Net5_0\NetJSON.Net5_0.csproj", "{49CFDAC0-D244-4112-A56B-B457E02C76C5}"
32+
EndProject
3133
Global
3234
GlobalSection(SolutionConfigurationPlatforms) = preSolution
3335
Debug|Any CPU = Debug|Any CPU
@@ -158,6 +160,18 @@ Global
158160
{A3C27161-165E-4357-9E1C-1A6FB334CF11}.NetFX-Release|Any CPU.Build.0 = Release|Any CPU
159161
{A3C27161-165E-4357-9E1C-1A6FB334CF11}.Release|Any CPU.ActiveCfg = Release|Any CPU
160162
{A3C27161-165E-4357-9E1C-1A6FB334CF11}.Release|Any CPU.Build.0 = Release|Any CPU
163+
{49CFDAC0-D244-4112-A56B-B457E02C76C5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
164+
{49CFDAC0-D244-4112-A56B-B457E02C76C5}.Debug|Any CPU.Build.0 = Debug|Any CPU
165+
{49CFDAC0-D244-4112-A56B-B457E02C76C5}.NetCore-Debug|Any CPU.ActiveCfg = Debug|Any CPU
166+
{49CFDAC0-D244-4112-A56B-B457E02C76C5}.NetCore-Debug|Any CPU.Build.0 = Debug|Any CPU
167+
{49CFDAC0-D244-4112-A56B-B457E02C76C5}.NetCore-Release|Any CPU.ActiveCfg = Release|Any CPU
168+
{49CFDAC0-D244-4112-A56B-B457E02C76C5}.NetCore-Release|Any CPU.Build.0 = Release|Any CPU
169+
{49CFDAC0-D244-4112-A56B-B457E02C76C5}.NetFX-Debug|Any CPU.ActiveCfg = Debug|Any CPU
170+
{49CFDAC0-D244-4112-A56B-B457E02C76C5}.NetFX-Debug|Any CPU.Build.0 = Debug|Any CPU
171+
{49CFDAC0-D244-4112-A56B-B457E02C76C5}.NetFX-Release|Any CPU.ActiveCfg = Release|Any CPU
172+
{49CFDAC0-D244-4112-A56B-B457E02C76C5}.NetFX-Release|Any CPU.Build.0 = Release|Any CPU
173+
{49CFDAC0-D244-4112-A56B-B457E02C76C5}.Release|Any CPU.ActiveCfg = Release|Any CPU
174+
{49CFDAC0-D244-4112-A56B-B457E02C76C5}.Release|Any CPU.Build.0 = Release|Any CPU
161175
EndGlobalSection
162176
GlobalSection(SolutionProperties) = preSolution
163177
HideSolutionNode = FALSE

NetJSON/NetJSON.Internals.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ sealed class NetJSONMemberInfo
9393

9494
static partial class CompatibleExtensions
9595
{
96-
#if !NET_STANDARD && !NET_PCL && !NET_46 && !NET_47
96+
#if !NET_STANDARD && !NET_PCL && !NET_46 && !NET_47 && !NET_5
9797
internal static Type GetTypeInfo(this Type type) {
9898
return type;
9999
}

NetJSON/NetJSON.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1131,7 +1131,7 @@ public static void GenerateTypesInto(string asmName, params Type[] types) {
11311131

11321132
}
11331133

1134-
#if !NET_STANDARD
1134+
#if !NET_STANDARD && !NET_5
11351135
assembly.Save(String.Concat(assembly.GetName().Name, _dllStr));
11361136
#endif
11371137
}
@@ -1159,7 +1159,7 @@ internal static Type Generate(Type objType) {
11591159

11601160
_types[objType] = returnType;
11611161

1162-
#if !NET_STANDARD
1162+
#if !NET_STANDARD && !NET_5
11631163
if (_generateAssembly)
11641164
assembly.Save(String.Concat(assembly.GetName().Name, _dllStr));
11651165
#endif
@@ -1376,7 +1376,7 @@ private static AssemblyBuilder GenerateAssemblyBuilder() {
13761376
lock (_lockAsmObject) {
13771377
if (_assembly == null) {
13781378
_assembly =
1379-
#if NET_STANDARD
1379+
#if NET_STANDARD || NET_5
13801380
AssemblyBuilder
13811381
#else
13821382
AppDomain.CurrentDomain
@@ -1385,7 +1385,7 @@ private static AssemblyBuilder GenerateAssemblyBuilder() {
13851385
new AssemblyName(NET_JSON_GENERATED_ASSEMBLY_NAME) {
13861386
Version = new Version(1, 0, 0, 0)
13871387
},
1388-
#if NET_STANDARD
1388+
#if NET_STANDARD || NET_5
13891389
AssemblyBuilderAccess.Run
13901390
#else
13911391
AssemblyBuilderAccess.RunAndSave
@@ -1428,7 +1428,7 @@ private static AssemblyBuilder GenerateAssemblyBuilder() {
14281428

14291429
private static AssemblyBuilder GenerateAssemblyBuilderNoShare(string asmName) {
14301430
var assembly =
1431-
#if NET_STANDARD
1431+
#if NET_STANDARD || NET_5
14321432
AssemblyBuilder
14331433
#else
14341434
AppDomain.CurrentDomain
@@ -1437,7 +1437,7 @@ private static AssemblyBuilder GenerateAssemblyBuilderNoShare(string asmName) {
14371437
new AssemblyName(asmName) {
14381438
Version = new Version(1, 0, 0, 0)
14391439
},
1440-
#if !NET_STANDARD
1440+
#if !NET_STANDARD && !NET_5
14411441
AssemblyBuilderAccess.RunAndSave
14421442
#else
14431443
AssemblyBuilderAccess.Run

NetJSON/NetJSON.nuspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
<id>NetJSON</id>
55
<title>NetJSON</title>
66
<tags>json json-serializer javascript JSON serializer binary</tags>
7-
<version>1.3.5</version>
7+
<version>1.3.6</version>
88
<authors>TJ Bakre</authors>
99
<description>Faster than Any Binary?</description>
1010
<releaseNotes>
11-
- Eliminate need to check default value for property/field when SkipDefaultValue is set to false
11+
- Add support for .NET 5.0
1212
</releaseNotes>
1313
<language>en-US</language>
1414
<licenseUrl>https://github.com/rpgmaker/NetJSON/blob/master/LICENSE.text</licenseUrl>

NetJSON/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@
3333
// You can specify all the values or you can default the Build and Revision Numbers
3434
// by using the '*' as shown below:
3535
// [assembly: AssemblyVersion("1.0.*")]
36-
[assembly: AssemblyVersion("1.3.5")]
37-
[assembly: AssemblyFileVersion("1.3.5")]
36+
[assembly: AssemblyVersion("1.3.6")]
37+
[assembly: AssemblyFileVersion("1.3.6")]
3838
#if !NET_35 && !NET_STANDARD
3939
[assembly: SecurityRules(SecurityRuleSet.Level2, SkipVerificationInFullTrust = true)]
4040
#endif

NetJSON/lib/net35/NetJSON.dll

-512 Bytes
Binary file not shown.

NetJSON/lib/net40/NetJSON.dll

0 Bytes
Binary file not shown.

NetJSON/lib/net462/NetJSON.dll

0 Bytes
Binary file not shown.

NetJSON/lib/net472/NetJSON.dll

0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)