简体   繁体   中英

Is there any way we can install .NETFramework 4.7.1 nuget into project using .netstandard2.0 or .netstandard3.0

I am trying to install nuget which was built using .NET Framework 4.7.1 into project which is on .netstandard 2.0. However, I am getting warning like

Package 'xyz' was restored using '.NETFramework,Version=v4.7.1' instead of the project target framework '.netstandard2.0'. This package may not be fully compatible with your project.

and nuget package is not getting installed correctly causing file missing exceptions when I run unit test cases. I can see 2 options resolving this issue:

  1. I should change my original nuget package to support .NET Framework 4.7.1 as well .netstandard 2.0. Not sure if this is feasible? If yes please let me know the steps.

  2. Changes my nuget consumer project to use both of these versions. I have given couple of tries to figure out the way using above options but still not luck!

Thanks all for your response. I was able to figure out the solution by creating new .net standard project and migrating the .net framework code to it: Good Reference to brush up the basics about these .NET offerings : https://code-maze.com/differences-between-net-framework-net-core-and-net-standard/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM