在ASP.NET Core中使用DirectoryServices

编程入门 行业动态 更新时间:2024-10-28 09:19:29
本文介绍了在ASP.NET Core中使用DirectoryServices的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在将我的ASP.NET Core RC1应用程序升级到RC2.我在某些* .cs文件中有对System.DirectoryServices和System.DirectoryServices.AccountManagement的引用,以便可以查询LDAP.但是我不知道如何在Project.json文件的RC2中添加对其的引用.我尝试的一切都会给我带来更多错误.感谢您的帮助.

I am upgrading my ASP.NET Core RC1 application to RC2. I have some references to System.DirectoryServices and System.DirectoryServices.AccountManagement in some *.cs files so that I can query LDAP. But I have no idea how to add references to it in RC2 in the Project.json file. Everything that I try just gives me more errors. Any help is appreciated.

{ "version": "1.0.0-*", "buildOptions": { "emitEntryPoint": true, "preserveCompilationContext": true }, "dependencies": { "Microsoft.NETCore.App": { "version": "1.0.0-rc2-3002702", "type": "default" }, "Microsoft.AspNetCore.Diagnostics": "1.0.0-rc2-final", "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0-rc2-final", "Microsoft.AspNetCore.Mvc": "1.0.0-rc2-final", "Microsoft.AspNetCore.Mvc.TagHelpers": "1.0.0-rc2-final", "Microsoft.AspNetCore.Server.Kestrel": "1.0.0-rc2-final", "Microsoft.AspNetCore.StaticFiles": "1.0.0-rc2-final", "Microsoft.AspNetCore.Razor.Tools": "1.0.0-preview1-final", "Microsoft.EntityFrameworkCore": "1.0.0-rc2-final", "Microsoft.EntityFrameworkCore.SqlServer": "1.0.0-rc2-final", "Microsoft.EntityFrameworkCore.Tools": "1.0.0-preview1-final", "Microsoft.EntityFrameworkCore.SqlServer.Design": "1.0.0-rc2-final", "Microsoft.Extensions.Configuration.FileExtensions": "1.0.0-rc2-final", "Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0-rc2-final", "Microsoft.Extensions.Configuration.Json": "1.0.0-rc2-final", "Newtonsoft.Json": "8.0.3", "Microsoft.Extensions.Logging": "1.0.0-rc2-final", "Microsoft.Extensions.Logging.Console": "1.0.0-rc2-final", "Microsoft.Extensions.Logging.Debug": "1.0.0-rc2-final", "Microsoft.VisualStudio.Web.BrowserLink.Loader": "14.0.0-rc2-final", "System.Linq": "4.0.1-beta-23516", "System.Linq.Queryable": "4.0.1-beta-23516" }, "tools": { "Microsoft.AspNetCore.Razor.Tools": { "version": "1.0.0-preview1-final", "imports": "portable-net45+win8+dnxcore50" }, "Microsoft.AspNetCore.Server.IISIntegration.Tools": { "version": "1.0.0-preview1-final", "imports": "portable-net45+win8+dnxcore50" }, "Microsoft.EntityFrameworkCore.Tools": { "version": "1.0.0-preview1-final", "imports": [ "portable-net45+win8+dnxcore50", "portable-net45+win8" ] }, "Microsoft.Extensions.SecretManager.Tools": { "version": "1.0.0-preview1-final", "imports": "portable-net45+win8+dnxcore50" }, "Microsoft.VisualStudio.Web.CodeGeneration.Tools": { "version": "1.0.0-preview1-final", "imports": [ "portable-net45+win8+dnxcore50", "portable-net45+win8" ] } }, "frameworks": { "netcoreapp1.0": { "imports": [ "dotnet5.6", "dnxcore50", "portable-net45+win8" ] } }, "publishOptions": { "include": [ "wwwroot", "Views", "appsettings.json", "web.config" ] }, "scripts": { "prepublish": [ "npm install", "bower install", "gulp clean", "gulp min" ] } }

推荐答案

目前,新的CoreCLR不支持该库.关于此的公开GitHub问题,您可以在其中找到更多信息和讨论. (如果仅将AD用于身份验证系统,则会在此处提供解决方法.)

The new CoreCLR doesn't support this library, at the moment. There's an open GitHub issue about this, where you can find more information and discussion. (A workaround is presented there if you are only using AD for your authentication system.)

如果您只打算在Windows服务器上运行此应用程序,则可以将"net452"作为框架的目标,并在其下方添加框架程序集.

If you're only planning on running this app on a Windows server, you could target "net452" for the framework and add the framework assemblies underneath that.

"frameworks": { "net452": { "frameworkAssemblies": { "System.DirectoryServices": "4.0.0.0", "System.DirectoryServices.AccountManagement": "4.0.0.0" } } },

更多推荐

在ASP.NET Core中使用DirectoryServices

本文发布于:2023-11-04 11:27:26,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1557804.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:NET   ASP   DirectoryServices   Core

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!