gpt4 book ai didi

c# - 无法更新 nuget 包 (PCL)

转载 作者:行者123 更新时间:2023-11-30 00:06:35 25 4
gpt4 key购买 nike

我在 Android 中使用 map 时遇到此错误:

System.MissingMethodEsception: Method
'Xamarin.Forms.maps.Android.MapRenderer.OnCameraChange' not found.

而且我了解到您可以更新 nugetpackage 来解决这个问题。但是,由于这个原因我无法安装它:

Could not install package 'TK.CustomMap 2.0.1'. You are trying to install this package into a project that targets '.NETPortable,Version=v4.5,Profile=Profile78', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.

软件包安装的更新只在 iOS 和 Android 中找到,但在 PCL 中找不到。我试图删除所有包,然后尝试添加 TK.Customs nuget 包,但同样的问题。

还尝试将它安装在一个新项目上,并且安装得很好。只是无法将其安装到我的旧项目中。

这是尝试更新包时的完整错误消息:

 Attempting to gather dependency information for package 'TK.CustomMap.2.0.1' with respect to project 'Vernamo', targeting '.NETPortable,Version=v4.5,Profile=Profile78'
GET https://api.nuget.org/v3/registration3-gz-semver2/tk.custommap/index.json
OK https://api.nuget.org/v3/registration3-gz-semver2/tk.custommap/index.json 175ms
Total number of results gathered : 29
Gathering dependency information took 232 ms
Summary of time taken to gather dependencies per source :
https://api.nuget.org/v3/index.json - 204.03 ms
Attempting to resolve dependencies for package 'TK.CustomMap.2.0.1' with DependencyBehavior 'Lowest'
Resolving dependency information took 0 ms
Resolving actions to install package 'TK.CustomMap.2.0.1'
Resolved actions to install package 'TK.CustomMap.2.0.1'
Found package 'TK.CustomMap 2.0.1' in '/Users/holger/Downloads/Vernamo/packages'.
For adding package 'TK.CustomMap.2.0.1' to project 'Vernamo' that targets 'portable45-net45+win8+wp8'.
Install failed. Rolling back...
Package 'TK.CustomMap.2.0.1' does not exist in project 'Vernamo'
Executing nuget actions took 52 ms
Could not install package 'TK.CustomMap 2.0.1'. You are trying to install this package into a project that targets '.NETPortable,Version=v4.5,Profile=Profile78', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.

最佳答案

TK.CustomMap 的预发布版本(至少 pre2)支持所有平台(参见 here),无论如何,从 pre3 (参见 here ),显然放弃了对所有平台的支持以支持 .NET Standard(在本例中为 1.1)。

您在 PCL 中使用的配置文件似乎与 .NET Standard 1.1 不兼容,因此 NuGet 无法添加引用。您可以尝试切换到另一个配置文件(例如 .NET 4.5.1),但我不知道这是否有帮助。另一种选择是将您的项目迁移到 .NET Standard。这是一种愚蠢的、重复的任务,但它是可能的。

关于c# - 无法更新 nuget 包 (PCL),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48869274/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com