1

I have a problem with the Nuget package Microsoft.Azure.ActiveDirectory.GraphClient.

From Nuget Package Manager, I have added Version 2.1.0 of said Nuget package to my project, but it seems the DLL cannot be found:

FileNotFoundException: Could not load file or assembly "Microsoft.Azure.ActiveDirectory.GraphClient, Version=2.1.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" or one of its dependencies. The system cannot find the file specified.

I have checked that the DLL does exist, and found that it is "File Version 1.0.9342.13", "Product Version 1.0.9342.13".

So I tried to add the file to the assemblyBinding in Web.config (although I'd expect VS to do that for me):

<dependentAssembly>
    <assemblyIdentity name="Microsoft.Azure.ActiveDirectory.GraphClient" publicKeyToken="31bf3856ad364e35"/>
    <bindingRedirect oldVersion="1.0.0.0-2.1.1.0" newVersion="1.0.9342.13"/>
</dependentAssembly>

but this didn't work.

Why is there a discrepancy in versions and what do I have to do so my program finds the DLL and the dependent assemblies?

Alexander
  • 19,906
  • 19
  • 75
  • 162
  • is the redirect required? Otherwise remove it or update it to the following `` – Jehof Aug 15 '17 at 07:50
  • When you have "2.1.0", a redirect to "1.0.9342.13" seems not reasonable to me. – Uwe Keim Aug 15 '17 at 07:51
  • 1
    @UweKeim The version in the explorer "Properties" window of the DLL file is 1.0.9342, so I tried that. – Alexander Aug 15 '17 at 07:57
  • When using [ILSpy](http://ilspy.net) on the [NuGet package](https://www.nuget.org/packages/Microsoft.Azure.ActiveDirectory.GraphClient/)'s contained DLL, it tells me: `Microsoft.Azure.ActiveDirectory.GraphClient, Version=2.1.10.0, Culture=neutral, PublicKeyToken=null`. So I suggest to set `newVersion` to that **2.1.10.0**. – Uwe Keim Aug 15 '17 at 08:07
  • @UweKeim: This gives me `FileLoadException: Die Datei oder Assembly "Microsoft.Azure.ActiveDirectory.GraphClient, Version=2.1.10.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" oder eine Abhängigkeit davon wurde nicht gefunden. Die gefundene Manifestdefinition der Assembly stimmt nicht mit dem Assemblyverweis überein. (Ausnahme von HRESULT: 0x80131040)` – Alexander Aug 15 '17 at 08:24
  • Maybe [this question and their answers](https://stackoverflow.com/q/215026/107625) helps? BTW: http://unlocalize.com/ is a great way to translate errors from German to English for further googling . – Uwe Keim Aug 15 '17 at 08:28
  • When you write "_I have downloaded Version ... into my project_", it seems you are not using the standard VS NuGet installation way? This usually adds the correct binding redirects automatically. – Uwe Keim Aug 15 '17 at 08:33
  • @UweKeim I have used Nuget but no binding was added to Web.config. I will clarify the question. – Alexander Aug 15 '17 at 09:33
  • @UweKeim Could it be that the error is caused because publicKeyTokens are different between the required version and the available version (31bf3856ad364e35 vs null)? – Alexander Aug 15 '17 at 10:22
  • @Alexander Just omit the whole `publicKeyToken` attribute and see what's happening. – Uwe Keim Aug 15 '17 at 12:00

0 Answers0