【问题标题】:Error building AspNet.Security.OpenIdConnect.Server构建 AspNet.Security.OpenIdConnect.Server 时出错
【发布时间】:2016-06-27 18:55:57
【问题描述】:

我正在尝试构建 AspNet.Security.OpenIdConnect.Server,但出现以下错误:

.NETStandard,Version=v1.3 error NU1002: The dependency System.Security.Cryptography.OpenSsl 4.0.0-rc3-23911 in project AspNet.Security.OpenIdConnect.Server does not support framework .NETStandard,Version=v1.3.

如果我在projects.json 中删除对netstandard1.3 的引用,则项目构建不会出错。

我在 Windows 上使用最新的不稳定 DNX (1.0.0-rc2-16595)。

谁能帮我弄清楚发生了什么?

提前致谢!

【问题讨论】:

  • 更多信息:如果我使用dnx web 从命令行执行该项目,我可以运行该项目而不会出错。但是,如果我尝试从 Visual Studio 内部构建它,我会收到上述错误。谢谢。

标签: asp.net-core openid-connect aspnet-contrib


【解决方案1】:

您看到的错误可能是由于某些 CoreFX Crypto 软件包最近更新为需要 netstandard1.4 而不是 dotnet5.4/netstandard1.3

4.0.0-rc3-23911:

<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2013/01/nuspec.xsd">
  <metadata minClientVersion="3.4">
    <id>System.Security.Cryptography.OpenSsl</id>
    <version>4.0.0-rc3-23911</version>
    <title>System.Security.Cryptography.OpenSsl</title>
    <authors>Microsoft</authors>
    <owners>microsoft,dotnetframework</owners>
    <licenseUrl>http://go.microsoft.com/fwlink/?LinkId=329770</licenseUrl>
    <iconUrl>http://go.microsoft.com/fwlink/?LinkID=288859</iconUrl>
    <requireLicenseAcceptance>true</requireLicenseAcceptance>
    <description>Provides cryptographic algorithm implementations and key management for non-Windows systems with OpenSSL.

Commonly Used Types:
System.Security.Cryptography.RSAOpenSsl
 \r\n TFS ID: 1583883, GitHub SHA: https://github.com/dotnet/corefx/tree/3cabb976e023a5fb43143f47cfbceca60c0268a5</description>
    <copyright>© Microsoft Corporation.  All rights reserved.</copyright>
    <tags></tags>
    <dependencies>
      <group targetFramework=".NETStandard1.4">
        <dependency id="runtime.native.System.Security.Cryptography" version="[4.0.0-rc3-23911, )" />
        <dependency id="System.Collections" version="[4.0.11-rc3-23911, )" exclude="Compile" />
        <dependency id="System.IO" version="[4.0.11-rc3-23911, )" />
        <dependency id="System.Resources.ResourceManager" version="[4.0.1-rc3-23911, )" exclude="Compile" />
        <dependency id="System.Runtime" version="[4.0.21-rc3-23911, )" />
        <dependency id="System.Runtime.Extensions" version="[4.0.11-rc3-23911, )" exclude="Compile" />
        <dependency id="System.Runtime.Handles" version="[4.0.1-rc3-23911, )" />
        <dependency id="System.Runtime.InteropServices" version="[4.0.21-rc3-23911, )" exclude="Compile" />
        <dependency id="System.Runtime.Numerics" version="[4.0.1-rc3-23911, )" exclude="Compile" />
        <dependency id="System.Security.Cryptography.Algorithms" version="[4.1.0-rc3-23911, )" />
        <dependency id="System.Security.Cryptography.Encoding" version="[4.0.0-rc3-23911, )" exclude="Compile" />
        <dependency id="System.Security.Cryptography.Primitives" version="[4.0.0-rc3-23911, )" />
        <dependency id="System.Text.Encoding" version="[4.0.11-rc3-23911, )" exclude="Compile" />
      </group>
    </dependencies>
  </metadata>
</package>

4.0.0-rc2-23826:

<?xml version="1.0"?>
<package xmlns="http://schemas.microsoft.com/packaging/2013/01/nuspec.xsd">
  <metadata minClientVersion="3.4">
    <id>System.Security.Cryptography.OpenSsl</id>
    <version>4.0.0-rc2-23826</version>
    <title>System.Security.Cryptography.OpenSsl</title>
    <authors>Microsoft</authors>
    <owners>microsoft,dotnetframework</owners>
    <licenseUrl>http://go.microsoft.com/fwlink/?LinkId=329770</licenseUrl>
    <iconUrl>http://go.microsoft.com/fwlink/?LinkID=288859</iconUrl>
    <requireLicenseAcceptance>true</requireLicenseAcceptance>
    <description>Provides cryptographic algorithm implementations and key management for non-Windows systems with OpenSSL.

Commonly Used Types:
System.Security.Cryptography.RSAOpenSsl
 \r\n TFS ID: 1579044, GitHub SHA: https://github.com/dotnet/corefx/tree/dacca1618c0dbb266945d42e58b9584e7c72126c</description>
    <copyright>© Microsoft Corporation.  All rights reserved.</copyright>
    <dependencies>
      <group targetFramework=".NETPlatform5.4">
        <dependency id="runtime.native.System.Security.Cryptography" version="4.0.0-rc2-23826" />
        <dependency id="System.Collections" version="4.0.0" />
        <dependency id="System.IO" version="4.0.10" />
        <dependency id="System.Resources.ResourceManager" version="4.0.0" />
        <dependency id="System.Runtime" version="4.0.20" />
        <dependency id="System.Runtime.Extensions" version="4.0.10" />
        <dependency id="System.Runtime.Handles" version="4.0.0" />
        <dependency id="System.Runtime.InteropServices" version="4.0.20" />
        <dependency id="System.Runtime.Numerics" version="4.0.0" />
        <dependency id="System.Security.Cryptography.Algorithms" version="4.0.0-rc2-23826" />
        <dependency id="System.Security.Cryptography.Encoding" version="4.0.0-rc2-23826" />
        <dependency id="System.Security.Cryptography.Primitives" version="4.0.0-rc2-23826" />
        <dependency id="System.Text.Encoding" version="4.0.10" />
      </group>
      <group targetFramework="MonoAndroid1.0" />
      <group targetFramework="MonoTouch1.0" />
      <group targetFramework=".NETFramework4.6" />
      <group targetFramework=".NETCore5.0" />
      <group targetFramework="Xamarin.iOS1.0" />
      <group targetFramework="Xamarin.Mac2.0" />
    </dependencies>
  </metadata>
</package>

这不会影响我们的构建,因为我们只使用 aspnetcidev 提要(还没有 CoreFX RC3 包),但是您最近可能使用 dotnet-core 提要下载了一个项目,这导致了 RC3要保存在全局包存储中的包 (.nuget\packages)。

要临时解决此问题,您可以重新定位 ASOS 以使用 netstandard1.4 或擦除您的 .nuget\packages 文件夹并使用 RC2 包。

【讨论】:

  • 感谢您的快速回答!我清除了包存储并将project.json 更改为使用netstandard1.4,现在所有依赖项都已成功解决。但是,当我尝试构建解决方案时,出现以下错误:CS1061: 'X509Store' does not contain a definition for 'Close' and no extension method 'Close' accepting a first argument of type 'X509Store' could be foundOpenIdConnectServerHelpers.cs 的第 152 行。我想知道是否真的需要在使用后将X509Store 告诉Close()。无论如何,非常感谢您的帮助。
  • 您是否也将 NETSTANDARD1_3 符号重命名为 NETSTANDARD1_4?
  • NETSTANDARD1_3 重命名为NETSTANDARD1_4 成功了。非常感谢!
  • 不错!很高兴你把它整理出来! ;)
  • 你好@Pinpoint,昨晚我从 GitHub 更新了我的 ASOS 副本,我正试图弄清楚发生了什么,也许你能帮助我?我进行了上述更改,当我通过dnx web 从命令行执行时,我能够毫无问题地运行该项目。但是,我无法从 VS2015 内部构建它。我收到几个 CS1705 错误。我认为 VS 使用与 dnx 相同的工具和编译器路径,但显然情况并非如此。你能帮助我或指出我正确的方向吗?再次感谢您的帮助。问候,佩德罗。
猜你喜欢
  • 2012-03-30
  • 2012-03-23
  • 2016-11-20
  • 2012-04-08
  • 2017-12-20
  • 2016-05-27
  • 2015-12-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多