Novell.Directory.Ldap.NETStandard":" 2.3.7"将无法解决.Net Core Project.json

时间:2017-06-02 13:51:12

标签: active-directory ldap asp.net-core-mvc .net-core

我需要查询ActiveDirectory,让用户选择名称并添加到他们保存的记录中。我不需要对AD进行身份验证,除了设置连接以进行查询。

我偶然发现了" Novell.Directory.Ldap.NETStandard"。

但是,当我尝试将其拉进去时说"包恢复失败"。 "依赖Novell.Directory.Ldap.NetStandard> = 2.3.7无法解决"。

这是我的project.json中的一行:

"Novell.Directory.Ldap.NETStandard": "2.3.7",

我在这篇文章中看到这个人试图使用它:

C# netcore ldap authentication using Novell.Directory.Ldap.NETStandard library

他遇到了麻烦,但至少看起来它正在尝试连接,所以他必须能够在project.json中安装依赖项。

任何人都知道如何安装此依赖项? 我真的想在project.json中手工完成。工具似乎真的破解了文件。 所以我犹豫不决:

Install-Package Novell.Directory.Ldap.NETStandard
包管理器中的

到目前为止,这是我完整的project.json:

{
  "dependencies": {
"Hrsa.Core.Generic.Model": "1.0.0-*",
"Microsoft.AspNetCore.Diagnostics": "1.0.0",
"Microsoft.AspNetCore.Identity.EntityFrameworkCore": "1.1.0",
"Microsoft.AspNetCore.Mvc": "1.1.1",
"Microsoft.AspNetCore.Mvc.TagHelpers": "1.1.1",
"Microsoft.AspNetCore.Razor.Tools": {
  "version": "1.0.0-preview2-final",
  "type": "build"
},
"Microsoft.AspNetCore.Session": "1.1.0",
"Microsoft.AspNetCore.Server.IISIntegration": "1.0.0",
"Microsoft.AspNetCore.Server.Kestrel": "1.0.1",
"Microsoft.AspNetCore.StaticFiles": "1.1.0",
"Microsoft.EntityFrameworkCore.SqlServer": "1.1.0",
"Microsoft.EntityFrameworkCore.Tools": "1.0.0-preview2-final",
"Microsoft.Extensions.Configuration.FileExtensions": "1.1.0",
"Microsoft.Extensions.Configuration": "1.1.0",
"Microsoft.Extensions.Configuration.Json": "1.1.0",
"Microsoft.Extensions.Options.ConfigurationExtensions": "1.0.0",
"Microsoft.Extensions.Logging.Console": "1.0.0",
//"Novell.Directory.Ldap.NETStandard": "2.3.0",
"Microsoft.NETCore.App": {
  "version": "1.0.1",
  "type": "platform"
},
"Swashbuckle.AspNetCore": "1.0.0-rc3",
"Hrsa.Core.Generic.Service": "1.0.0-*",
"Hrsa.Core.Generic.Repository": "1.0.0-*",
//"Microsoft.Extensions.DependencyModel": "1.1.1",
//"AutoMapper": "6.0.2",
//"AutoMapper.Extensions.Microsoft.DependencyInjection": "2.0.1",
"Hrsa.Core.Common": "1.0.0-*"

},

  "tools": {
"Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.0.0-preview2-final",
"Microsoft.AspNetCore.Razor.Tools": "1.0.0-preview2-final",
"Microsoft.EntityFrameworkCore.Tools": "1.0.0-preview2-final"

},

  "frameworks": {
"netcoreapp1.0": {
  "imports": [
    "dotnet5.6",
    "portable-net45+win8"
  ]
}

},

  "buildOptions": {
"emitEntryPoint": true,
"preserveCompilationContext": true

},

  "runtimeOptions": {
"configProperties": {
  "System.GC.Server": true
}

},

  "publishOptions": {
"include": [
  "wwwroot",
  "web.config",
  "Views",
  "appsettings.development.json",
  "appsettings.production.json",
  "appsettings.staging.json"
]

},

  "scripts": {
"postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ]
  }
    }

1 个答案:

答案 0 :(得分:1)

我继续跑了:

Install-Package Novell.Directory.Ldap.NETStandard

似乎解决了。 现在我会看看我是否真的可以让它发挥作用。