我正在尝试为我制作的 PCL 库创建一个 nuget 包。
这个 nuget 包旨在用于Xamarin 表单尽管申请。所以我什至不确定我所勾选的内容是否正确。
I really只关心.NET Framework 4。即my最低限度的框架。对于其余的,我根本不关心,也不知道我应该瞄准什么。
为了它的价值,我正在使用NuGet 包资源管理器 https://npe.codeplex.com/创建我的 NuGetnupkg
文件到manually在将它们发布到 NuGet 之前对其进行测试。
这是我尝试的屏幕截图,但 Xamarin Studio 未能添加 nuget 包(说它不是正确的东西)。
以及来自 Xam Studio 的错误消息:
Adding Foo...
Adding 'Foo 1.3.0' to Core.
Could not install package 'Foo 1.3.0'. You are trying to install this package into a project that targets 'portable-net45+win+wp80+MonoTouch10+MonoAndroid10+xamarinmac20+xamarinios10', 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.
对于 Xamarin.Forms,适合可移植类库 (PCL) 项目使用的两个配置文件是 Profile 78 或 Profile 259。Xamarin.Forms 可以在其他配置文件中使用,但如果您的 PCL 项目针对其中之一,则应该好的。您的项目似乎以 Profile 78 为目标。
以下是 Xamarin.Forms PCL 配置文件供参考。
Xamarin.Forms 1.3:
portable-win+net45+wp80+MonoAndroid10+MonoTouch10
Xamarin.Forms 1.4:
portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10
您的 NuGet 包存在问题,它没有表明它在 PCL 中支持 Windows 8。 NuGet 将查看构成项目 PCL 配置文件的所有单独框架(忽略 Xamarin 和 Mono 框架,因为如果 NuGet 包的 PCL 配置文件中没有它们,则它们是可选的)并确保 NuGet 包的 PCL 配置文件具有框架这是兼容的。如果 NuGet PCL 没有匹配的框架,则 NuGet 认为它不兼容。
因此,您的 NuGet 包的可移植库文件夹需要包含 win
portable-net4+sl5+wp8+win
然后,您可以将 NuGet 包安装到 Profile 78 PCL 项目中。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)