dmitry-bym / JsonKnownTypes

Simple way to serialize and deserialize polymorphic types for Json.NET

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Want to target .NET version 4.6.1

theglobe opened this issue · comments

I get the following error when trying to install through NuGet:
Could not install package 'JsonKnownTypes 0.4.1'. You are trying to install this package into a project that targets '.NETFramework,Version=v4.6.1', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.

.Net framework 4.6.1 isn't compatible with .net standard 2.0. You need at least .Net framework 4.6.2. But i will add support for 4.6.1 version

Thanks!

According to https://docs.microsoft.com/en-us/dotnet/standard/net-standard the minimum for .NET Standard 2.0 is .NET Framework 4.6.1, or am I reading something wrong?

Note the footnote for that entry:

2 The versions listed here represent the rules that NuGet uses to determine whether a given .NET Standard library is applicable. While NuGet considers .NET Framework 4.6.1 as supporting .NET Standard 1.5 through 2.0, there are several issues with consuming .NET Standard libraries that were built for those versions from .NET Framework 4.6.1 projects. For .NET Framework projects that need to use such libraries, we recommend that you upgrade the project to target .NET Framework 4.7.2 or higher.

Will there be any issues with JsonKnownTypes and .NET Framework 4.6.1? Newtonsoft.Json works, so I hope this will work too.

Created a pull request, #16

Is there any activity here? :)

@theglobe I checked it, #16 it is good but i need to add not just .NET Framework 4.6.1. I think i need to add all platforms which are use in Json.NET but i can't do it now, sorry. I have a looot of work)

Work is everywhere 👍

I did a small investigation into which frameworks can be added with the least amount of effort and checked which frameworks Newtonsoft.Json targets, they are:
net45;net40;net35;net20;netstandard1.0;netstandard1.3;netstandard2.0

JsonKnownTypes
Without rewriting anyting in JsonKnownTypes, we can target
net461;net46;net45;netstandard2.0
(Targeting all of Newtonsofts frameworks gives errors for some of the frameworks.)

Targeting for example netstandard1.3 gives errors such as
'Attribute' does not contain a definition for 'GetCustomAttribute'

JsonKnownTypes.UnitTests
For the test project, Newtonsoft.Json.Test targets
net46;net40;net35;net20;netcoreapp3.0;netcoreapp2.2;netcoreapp2.1
Which are not compatible with some packages used in JsonKnownTypes.UnitTests, giving errors like
Package AutoFixture 4.11.0 is not compatible with net40

Why do they target more in their Test project, e.g. net46?

Without changing anyting in JsonKnownTypes.UnitTests, we can target
net461;net46;netcoreapp3.0;netcoreapp2.2;netcoreapp2.1

JsonKnownTypes.Benchmark
And similarly; Without changing anyting in JsonKnownTypes.Benchmark, we can target
net461;netcoreapp3.0;netcoreapp2.2;netcoreapp2.1