我有这个软件包的问题,我想在我的Xamarin表单上使用.net标准2.0
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.
这是否意味着我不能再使用这个库?
这是否意味着我不能再使用这个库?
不,您应该能够在.NET Standard 2.0
类库中使用几乎所有符合PCL规范的库。您可以查看.NET documentation以查看其支持的平台及其相应的.NET Standard支持版本的PCL配置文件列表。
包装警告说明
使用.NET Standard 2.0
和.NET Core SDK 2+
中的更新工具,.NET团队希望更容易更新或使用.NET标准库。问题是并非所有NuGet包都已更新以支持.NET Standard版本。因此,他们推出了fallback targeting .NET Framework 4.6.1
,它是带有.NET标准的nearly 100% compliant(.NET Standard 2.0
规范中有一些API不在.NET Framework 4.6.1
中,但如果需要,可以通过NuGet包引入)。因此,您看到的警告是通知您程序包不符合您所针对的.NET标准版本,因此可能包含使用.NET Standard 2.0
库在您的运行时中无法执行的API。
一旦你测试了一切都按预期工作,你可以将NoWarn="NU1701"
添加到PackageReference
中的csproj
,这将删除警告。有一点需要注意,将NoWarn="NU1701"
添加到单个包中不会删除依赖项的警告。要删除这些警告,您必须将它们包含在PackageReferences中(通过NuGet)或忽略项目级别的NU1701
警告。
如果您遇到后备问题,可以通过覆盖AssetTargetFallback
中的csproj
来调整目标框架后备,如下所示:
<AssetTargetFallback>$(AssetTargetFallback);portable-net45+win8+wpa81;</AssetTargetFallback>