We are upgrading our solution of multiple projects. Starting with one class library which is been referenced by 13 projects. I need to upgrade my class library project .NET Framework 4.5
to .NET Standard 2.1
.
Here the problem is:
This class library is being referenced by projects of .NET Framework 4.5
and its throwing error that it can't access .NET Standard 2.1
lib
Project 'abc.csproj' targets 'netstandard2.1'. It cannot be referenced by a project that targets '.NETFramework,Version=v4.5'.
How to resolve this problem? Upgrading all those 13 projects is not possible at the same time.
EDIT:
Following comments, if I convert lib to .netstandard1.1
then errors start coming in the library itself:
After downgrading lib to .netstandard1.1
, following on
NetStandard 1.4 does not allow decorating class with [DataContract]. I saw this post and added this package System.Runtime.Serialization.Primitives
:
I even added reference to older dll but, still getting error: