0

I have created a basic template Class library (see image below) and added just one reference system.text.json (version 6.0.2) through manage nuggets

enter image description here

enter image description here

Created a Console application with the above Class library as reference. (basic template just added reference to the class library)

enter image description here

Is throws error starting version 6.0.2 and tested 6.0.3 and 6.0.4 as well same issue whenever this code is existing JsonSerializer.Deserialize

Am I missing prerequisite reference to make this work ? Have tried the binding redirect with no success either. Please Advise

Below are the version of the framework used

enter image description here

MeeGee
  • 25
  • 1
  • 7
  • What's the version of your .net – D-Shih May 30 '22 at 04:14
  • I have update the question to add the framework details of the Console (.NET 5.0) and Class library (.NET Framework 4.8) – MeeGee May 31 '22 at 10:20
  • You might need to use `.NET Standard` instead of in `.NET Framework 4.8` Class library, because `.NET Framework 4.8` might not use in .net core – D-Shih May 31 '22 at 10:48
  • otherwise, you might use `.NET 5.0` for your Class library – D-Shih May 31 '22 at 10:49
  • According to their link https://www.nuget.org/packages/System.Text.Json .Net Framework is supported not sure why is not working – MeeGee Jun 01 '22 at 12:41

1 Answers1

0

You need to upgrade "system.text.json" version in console application. Root cause : In class library some of the reference have dependency with "system.text.json" versions that you have in class library project but not console application.

Vijay
  • 51
  • 1
  • 1