I have an application in .net core. the application was running fine, but the error started coming after I installed
dotnet add package Microsoft.AspNetCore.Authentication.Negotiate --version 6.0.14
Once I installed this package and put this line of code in startup.cs file:
services.AddAuthentication(NegotiateDefaults.AuthenticationScheme)
.AddNegotiate();
services.AddAuthorization(options =>
{
options.FallbackPolicy = options.DefaultPolicy;
});
I started getting this error:
System.IO.FileNotFoundException: 'Could not load file or assembly 'System.DirectoryServices.Protocols, Version=6.0.0.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.'
I installed this package when I saw the above error:
dotnet add package System.DirectoryServices --version 7.0.0
I am still getting this error. The error is coming in program.cs file. below is the screen shot of the error:
unfortunately, I dont see version 6.0.0.1 for System.directoryServices.protocols in nuget. Not sure, why the application is looking for 6.0.0.1 version when I have 7.0.0 version installed. Below is packages installed on my application:
I tried putting this in my web.config file:
<configuration>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.DirectoryServices.Protocols" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.0.0.1" newVersion="7.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</configuration>