简体   繁体   English

GalaSoft.MvvmLight Package 参考错误与 .net 标准 2.0 项目

[英]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 包:

  1. MVVMLight (5.4.1.1) MVVMLight (5.4.1.1)

  2. 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:看我更新的截图:

在此处输入图像描述

Refer: mvvmlight参考: mvvmlight

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 类型或名称空间名称“ Ioc”在名称空间“ GalaSoft.MvvmLight”中不存在 - The type or namespace name 'Ioc' does not exist in the namespace 'GalaSoft.MvvmLight' GalaSoft.MvvmLight.WP71编译错误,需要为RelayCommand添加对System.Windows的引用 - GalaSoft.MvvmLight.WP71 Compilation error , require to add reference to System.Windows for the RelayCommand 在.Net标准2.0项目中添加dll参考 - Adding dll reference in .Net standard 2.0 project 面向.net 4.7.1的项目无法引用依赖于.net standard 2.0的NuGet程序包 - Project that targets .net 4.7.1 cannot reference a NuGet package that depends on .net standard 2.0 .NET Framework 4.7 到 .NET 5 迁移与 Galasoft MVVMLight 库 - .NET Framework 4.7 to .NET 5 Migration with Galasoft MVVMLight Library Serilog Seq 包未安装在 .NET Standard 2.0 库项目上 - Serilog Seq package does not install on .NET Standard 2.0 library project 为什么 .NET 框架项目可以作为参考添加到 .NET 标准 2.0 项目中? - Why .NET framework project can be added as reference in .NET Standard 2.0 project? 在我的.Net Core 2.0项目中,使用.Net FW软件包代替.Net Standard(警告NU1701) - In my .Net Core 2.0 project, .Net FW package is used instead of .Net Standard (warning NU1701) 如何从 a.Net 标准 2.0 添加对 a.Net Core 3.1 项目的引用? - How to add a reference to a .Net Core 3.1 project from a .Net standard 2.0? .NET Standard 2.0 NuGet包生成 - .NET Standard 2.0 NuGet Package Generation
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM