1

We have an ASP.NET app with N number of projects. Two projects both reference a third party library - DocumentFormat.OpenXml.dll. One project - project A - references version 2.0.5022.0 of the library. Another project - project B - references version 2.5.5631.0 of the library. We get a build warning when the solution is built about the conflict between the two versions of the same DLL. Version 2.5.5631.0 is the version that ends up in the \bin directory.

At runtime, when I test the functionality provided by assembly A (built from project A) on an internal QA server, the functionality works. However, that's not what I expected. I expected to get a System.IO.FileLoadException error:

System.IO.FileLoadException: Could not load file or assembly 'DocumentFormat.OpenXml, Version=2.0.5022.0...

Note that there are no bindingRedirects for this DLL in the web.config file of the app.

The reason why this issue came to my attention is that we are in fact getting the System.IO.FileLoadException error message on a customer's server. I can't understand why we're not getting the same error on our QA server. Any ideas?

dnickels
  • 833
  • 1
  • 9
  • 21
  • Is there a project C that references both project A and project B? Does project A reference project B or vice versa. What type of project are project A and B? Have you installed any of the DLLs in the GAC? – Martin Brown Nov 08 '16 at 16:41
  • Look at the "Specific Version" property of the two references. – Igor Nov 08 '16 at 16:57
  • @Martin Brown. Both projects A and B are class libraries. There is a project called "Web" that references both project A and project B. Projects A and B do not reference each other. No DLLs are installed in the GAC. – dnickels Nov 08 '16 at 17:46
  • @Igor - The "Specific Version" property of the reference in project B (that references the 2.5.5631.0 version of the DLL) is set to True. The "Specific Version" property of reference in project A (that references the 2.0.5022.0 version of the DLL) is set to False. My understanding is that this property is a compile time property only though (not a runtime property). See http://stackoverflow.com/questions/24022134/how-exactly-does-the-specific-version-property-of-an-assembly-reference-work-i. – dnickels Nov 08 '16 at 17:50

0 Answers0