为什么我收到有关版本和文化中看似相同的程序集引用的警告

时间:2017-04-20 07:36:43

标签: c# .net xamarin mono

我在Mac上使用Xamarin并构建了一系列.netstandard1.3库。其中一个是引用一些外部包:

  1. NETStandard.Library
  2. Newtonsoft.Json
  3. System.Linq.Queryable
  4. System.Reactive
  5. System.Security.Principal
  6. 当我构建项目(库)时,它会构建,但会出现以下警告:

      

    /Library/Frameworks/Mono.framework/Versions/4.8.1/lib/mono/xbuild/14.0/bin/Microsoft.CSharp.targets(CoreCompile target) - >

         

    CSC:警告CS1702:假设装配参考   workspace/local/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:318: SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#snimissingwarning. SNIMissingWarning /home/rahul/workspace/repository/inteliexam_workspace/local/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:122: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#insecureplatformwarning. InsecurePlatformWarning Using cached django_twilio-0.8.0-py2.py3-none-any.whl Collecting django-phonenumber-field>=0.6 (from django-twilio) Using cached django-phonenumber-field-1.3.0.tar.gz Could not import setuptools which is required to install from a source distribution. Traceback (most recent call last): File "/home/rahul/workspace/repository/inteliexam_workspace/local/lib/python2.7/site-packages/pip/req/req_install.py", line 387, in setup_py import setuptools # noqa File "/home/rahul/workspace/repository/inteliexam_workspace/local/lib/python2.7/site-packages/setuptools/__init__.py", line 12, in <module> import setuptools.version File "/home/rahul/workspace/repository/inteliexam_workspace/local/lib/python2.7/site-packages/setuptools/version.py", line 1, in <module> import pkg_resources File "/home/rahul/workspace/repository/inteliexam_workspace/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 70, in <module> import packaging.version ImportError: No module named packaging.version System.Runtime.Serialization.Primitives,Version = 4.1.1.0,   Culture = neutral,PublicKeyToken = b03f5f7f11d50a3a'。   您可能需要提供运行时策略

    我不是在任何地方直接引用这个特定的库,但即使我是版本和公钥令牌似乎是相同的,为什么投诉呢?我如何摆脱这个警告,为什么我得到它?

1 个答案:

答案 0 :(得分:0)

尽管具有相同的程序集标识,但System.Runtime.Serialization.Primitives.dll的实现方式有所不同,大概是由于运行时特定的行为/实现。 MSBuild不确定要使用哪个。您可以将库定位到多个运行时,也可以将其作为NuGet包进行分发,这会将选择目标运行时的责任转移到使用您的包的库或应用程序。您可以下载该软件包,将其更改为.zip,然后深入了解我的意思。