我试图让Npgsql(.NET的PostgreSQL提供程序)可供Xamarin用户使用。 Npgsql已经支持.NET平台标准(版本3),标准文档包含以下句子:
如果库以.NET Platform Standard 1.3版为目标,则它只能在.NET Framework 4.6或更高版本,.NET Core,Universal Windows Platform 10(UWP)和Mono / Xamarin平台上运行。
我可以从我的Xamarin.Android项目成功安装Npgsql nuget。但是,当我尝试构建时,我收到以下错误:
System.IO.FileNotFoundException: Could not load assembly 'System.Security.Cryptography.Algorithms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. Perhaps it doesn't exist in the Mono for Android profile?
现在,这些包(就像Npgsql所依赖的许多RC2包一样)有一个包含。的lib / MonoAndroid10目录(在ref中也一样),这似乎表明Mono支持包.Android,但不需要DLL(因为逻辑是框架的一部分)。这很棒,但Xamarin.Android构建过程包括一个ResolveAssemblies任务,它遍历DLL依赖图(this is the relevant code)。由于Npgsql的netstandard13 DLL引用了System.Security.Cryptography.Algorthims.dll,因此失败。
我很困惑,nuget宣称"它都很好",而构建过程本身似乎显然与消耗netstandard13依赖性不兼容。
有什么想法吗?