Home > front end >  reference .net6 dll on .net framework 4.8 project
reference .net6 dll on .net framework 4.8 project

Time:11-01

I have an class library targetting the .Net Framework 4.8.

I'm trying to add a reference to the enter image description here

CodePudding user response:

I finally found what was going on.

From what I understand, the .NET Standard is a specification that aims at providing compatibility, in particular between frameworks.

My project uses the .Net Framework 4.8 (latest) and I was trying to add a reference to a .NET5/6 dll, when I should have been adding the .NET Standard 2.0 dll, which works in the .Net Framework (4.8).

After adding the right dll (netstandard 2.0) the project could build and run. There were a number of issues after related to dependencies and I ended up installing the pnp package through the "Manage Nuget Packages" option under "Project" instead of referencing the individual dll.

Just adding this in case it helps someone in the future.

Related: Using CSOM for .NET Standard instead of CSOM for .NET Framework

  • Related