[英]GalaSoft.MvvmLight Package reference error with .net Standard 2.0 project
Hi Stackoverflow community,嗨 Stackoverflow 社区,
I am in the process of creating a.Net Standard 2.0 Library project for my Xamarin Cross Platform App.我正在为我的 Xamarin 跨平台应用程序创建一个 .Net Standard 2.0 库项目。
For the Droid project which references the above project I am getting the following error for one of the NuGet packages:对于引用上述项目的 Droid 项目,对于 NuGet 软件包之一,我收到以下错误:
Can not resolve reference: 'GalaSoft.MvvmLight', referenced by 'NetStdLibProject'. Please add a NuGet package or assembly reference for 'GalaSoft.MvvmLight', or remove the reference to 'NetStdLibProject'. NetProject.Droid
I have added following NuGet Packages to my NetStdLibProject project:我在我的 NetStdLibProject 项目中添加了以下 NuGet 包:
MVVMLight (5.4.1.1) MVVMLight (5.4.1.1)
MVVMLightLibs (5.4.1.1) [This has following warning] MVVMLightLibs (5.4.1.1) [这有以下警告]
(Package 'MvvmLightLibs 5.4.1.1' was restored using '.NETFramework,Version=v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework,Version=v4.7.2, .NETFramework,Version=v4.8' instead of the project target framework '.NETStandard,Version=v2.0'. This package may not be fully compatible with your project.) (包 'MvvmLightLibs 5.4.1.1' 使用 '.NETFramework,Version=v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework ,Version=v4.7.2, .NETFramework,Version=v4.8' 而不是项目目标框架 '.NETStandard,Version=v2.0'。这个 package 可能与你的项目不完全兼容。)
Please advise if there is a way to handle this scenario, or even if I am missing something.请告知是否有办法处理这种情况,或者即使我遗漏了什么。 Also, please let me know if I need to include other related/beneficial packages.
另外,如果我需要包含其他相关/有益的软件包,请告诉我。
PS: Me and my colleagues use Visual Studio 2019 (Windows & Mac both, Mac for IOS part to be somewhat specific) PS:我和我的同事使用 Visual Studio 2019(Windows 和 Mac 都使用,Mac for IOS 部分有点具体)
Thanks for reading and any help is highly appreciated.感谢您的阅读,非常感谢您的帮助。
As Jason suggested in the comment, you should install MvvmLightLibsStd10 for .NET Standard
:正如 Jason 在评论中建议的那样,您应该为
.NET Standard
安装MvvmLightLibsStd10 :
You should uninstall the MvvmLightLibs
package and install MvvmLightLibsStd10
for all projects (sharedPrject,Android.project,iOS.project).您应该卸载
MvvmLightLibs
package 并为所有项目(sharedPrject、Android.project、iOS项目)安装MvvmLightLibsStd10
。
Right click your solution (not single project) and choose Manage Nuget Package for solution
.右键单击您的解决方案(不是单个项目)并选择
Manage Nuget Package for solution
。
see my updated screenshot:看我更新的截图:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.