Impossible to migrate the "System.Directory.Services.Protocols" dll from version "4.0.0" to "5.0.1" with nuget (.net framework 4.8)

Viewed 146

I have a project that uses the "System.Directory.Services.Protocols" dll which is in version 4.0 and references the framework:

C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.8\System.DirectoryServices.Protocols.dll.

I want to update the dll because there is a security hole in 5.0.0 fixed in 5.0.1.

But when I update with nuget (after removing the reference from my project), everything goes correctly (I don't get any error) but the referenced dll is still the one from framework 4.8.

I tried to reference it manually by adding it from the "net-standard 2.0" package directory

Packages\System.DirectoryServices.Protocols.5.0.1\lib
    | net45\ <empty>
    | netstandard2.0\System.DirectoryServices.Protocols.dll 

but it doesn't work any better.

I thought the 4.8 framework was compatible with .net standard 2.0, so why doesn't it select this dll?

1 Answers

Encountered the same issue with fx4.8 and System.Directory.Services.Protocols nuget package version 6.0.1. I think the problem is the incorrect package. Try to bind version using app.config, for example:

<configuration>
    <runtime>
        <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="4.0.0.0" />
            </dependentAssembly>
        </assemblyBinding>
    </runtime>
</configuration>
Related