[英]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.我正在尝试将使用 .NET Framework 4.7.1 构建的 nuget 安装到 .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'. Package 'xyz' 是使用 '.NETFramework,Version=v4.7.1' 而不是项目目标框架 '.netstandard2.0' 恢复的。 This package may not be fully compatible with your project.此 package 可能与您的项目不完全兼容。
and nuget package is not getting installed correctly causing file missing exceptions when I run unit test cases.和 nuget package 在我运行单元测试用例时没有正确安装导致文件丢失异常。 I can see 2 options resolving this issue:我可以看到解决此问题的 2 个选项:
I should change my original nuget package to support .NET Framework 4.7.1 as well .netstandard 2.0.我应该更改我原来的 nuget package 以支持 .NET Framework 4.7.1 以及 .netstandard 2.0。 Not sure if this is feasible?不确定这是否可行? If yes please let me know the steps.如果是,请告诉我步骤。
Changes my nuget consumer project to use both of these versions.更改我的 nuget 消费者项目以使用这两个版本。 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/ 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/
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.