Lit*_*nny 0 package xamarin .net-core-2.0 .net-standard-2.0
我想在使用 .net 标准 2.0 的 Xamarin 表单上使用这些软件包时遇到问题
Package 'ExifLib.PCL 1.0.1' was restored using '.NETFramework,Version=v4.6.1' instead of the project target framework '.NETStandard,Version=v2.0'. This package may not be fully compatible with your project.
Package 'Microsoft.Bcl 1.1.6' was restored using '.NETFramework,Version=v4.6.1' instead of the project target framework '.NETStandard,Version=v2.0'. This package may not be fully compatible with your project.
Package 'Microsoft.Bcl.Async 1.0.165' was restored using '.NETFramework,Version=v4.6.1' instead of the project target framework '.NETStandard,Version=v2.0'. This package may not be fully compatible with your project.
Package 'Mobilist.AdvancedTimer.Forms.Plugin 1.0.1' was restored using '.NETFramework,Version=v4.6.1' instead of the project target framework '.NETStandard,Version=v2.0'. This package may not be fully compatible with your project.
Package 'PCLStorage 1.0.2' was restored using '.NETFramework,Version=v4.6.1' instead of the project target framework '.NETStandard,Version=v2.0'. This package may not be fully compatible with your project.
Package 'Rg.Plugins.Popup 1.0.4' was restored using '.NETFramework,Version=v4.6.1' instead of the project target framework '.NETStandard,Version=v2.0'. This package may not be fully compatible with your project.
Run Code Online (Sandbox Code Playgroud)
这是否意味着我不能再使用这个库了?
这是否意味着我不能再使用这个库了?
不,您应该能够在类库中使用几乎所有符合 PCL 规范的.NET Standard 2.0库。您可以查看.NET 文档以查看 PCL 配置文件列表及其支持的平台和相应的 .NET Standard 支持版本。
包装警告说明
通过.NET 团队中.NET Standard 2.0的更新工具,.NET Core SDK 2+希望能够更轻松地更新或使用 .NET Standard 库。问题是并非所有 NuGet 包都已更新为支持 .NET Standard 版本。于是他们推出了后备目标 .NET Framework 4.6.1是接近100%兼容与.NET标准(有一些API是在.NET Standard 2.0那些不符合规格.NET Framework 4.6.1,但他们可以通过在包的NuGet如果需要,带来了)。因此,您看到的警告是通知您包不符合您所针对的 .NET Standard 版本,因此可能包含在使用您的.NET Standard 2.0库的运行时中不可执行的 API 。
一旦你已经测试一切工作的期望,您可以添加NoWarn="NU1701"到您PackageReference在csproj其中会删除该警告。需要注意的一件事是添加NoWarn="NU1701"到单个包不会删除依赖项的警告。要删除这些警告,您必须将它们包含为 PackageReferences(通过 NuGet)或忽略NU1701项目级别的警告。
如果您遇到回退问题,您可以通过将AssetTargetFallback您的中的覆盖为以下内容来调整目标框架回退csproj:
<AssetTargetFallback>$(AssetTargetFallback);portable-net45+win8+wpa81;</AssetTargetFallback>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1049 次 |
| 最近记录: |