Last post May 10, 2018 08:00 PM by klouapple
May 08, 2018 01:34 PM|klouapple|LINK
I have two questions;
1.I am looking for how to use .net core to access AD, any sample code? I had used DirectoryServices in standard dotnet, but .net core does not support DirectoryServices.
2. Is it possible I still can use standard .net dll in .net core application (MVC)?
May 09, 2018 07:57 AM|Edward Z|LINK
Do you run Asp.Net Core project in Windows to access or AD or other platform?
Currently, System.DirectoryServices in Microsoft.Windows.Compatibility only support Windows.
>> Is it possible I still can use standard .net dll in .net core application (MVC)?
You could reference .net standard dll in .net core.
May 09, 2018 02:36 PM|klouapple|LINK
Thanks you so much Edward.
I have a core mvc application need to access AD.
So for now we are unable to use dotnet core to access AD.
You mentioned we can reference .net standard dll in .net core, how to do it, could you send me links
May 10, 2018 02:18 AM|Edward Z|LINK
Have you tried "Microsoft.Windows.Compatibility" in Asp.Net Core to use System.DirectoryServices?
Do you receive any issue with above library?
>>how to do it, could you send me links
Do you receive any issue while referencing the .net standard dll from .net core project?
May 10, 2018 06:31 PM|klouapple|LINK
I can reference a standard dll or project in .net core project, and run well, such as public int Add(int x, int y) function in s standard dll.
When I reference my Standard AD dll, it could not run, I may need to add System.DirectoryServices dll and then reference it in .net core project, I need to figure out where I can get System.DirectoryServices dll file.
May 10, 2018 07:05 PM|klouapple|LINK
the following is the error I get where It calls MyActiveDirectory myActiveDirectory =
System.IO.FileNotFoundException: 'Could not load file or assembly 'System.DirectoryServices, Version=184.108.40.206, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.'
May 10, 2018 08:00 PM|klouapple|LINK
I can get system.System.DirectoryServices by using nugget, See the link below. once get the dll, it works.
Thank you so much for the help