4

When a given DLL references a specific version of a 2nd DLL it works. But if the version of the 2nd is newer than the referenced version, my library project, which uses both libraries, yields a warning:

Warning 1 Found conflicts between different versions of the same dependent assembly.

And FxCop states:

Warning 15 CA0060 : The indirectly-referenced assembly 'NationalInstruments.Common, Version=9.0.40.362, Culture=neutral, PublicKeyToken=dc6ad606294fc298' could not be found. This assembly is not required for analysis, however, analysis results could be incomplete. This assembly was referenced by: SimpleReadWrite

Until these warnings are solved I can't reference my library in no other project. I'm trying to use

  • NationalInstruments.NI4882.dll

In my SimpleReadWrite project, but NationalInstruments.NI4882 references

  • NationalInstruments.Common.dll v9.0.40.362

and I could only find a newer version (9.1.40.159). How to solve this problem?

Jader Dias
  • 88,211
  • 155
  • 421
  • 625
  • Did I understand you correctly - you want to reference two versions of the same DLL at once from one project? How are going to deal with name collisions? – Doc Brown Dec 21 '11 at 15:58
  • @Doc No I'm not. I want to use a single version, the problem is that I don't have the version required, but a newer one. Is there any workaround? – Jader Dias Dec 21 '11 at 16:00
  • Sorry, I don't get you. You have a "SimpleReadWrite" project, with source code, so you can change any references you want, and you compile it using NationalInstruments.Common.dll v9.1.40.159 - since this is the only version you have at hand. Where does the problem arise? Or do you have "SimpleReadWrite" only as a DLL, without source? – Doc Brown Dec 21 '11 at 16:08
  • @Doc The problem is that NationalInstruments.NI4882, not my project, references a specific version of NationalInstruments.Common that I don't have. I edited the question to clear this confusion. – Jader Dias Dec 21 '11 at 16:10
  • I'm hoping that I can change NationalInstruments.NI4882.dll to reference any version of the NationalInstruments.Common without having to recompile it, since I have no access to its source. – Jader Dias Dec 21 '11 at 16:13
  • 1
    Ah, ok, you wrote "*it references*", and I did not get immediately what you meant by "*it*". .NET prohibits mixing up DLLs which do not belong together for good reasons - if NationalInstruments.NI4882.dll is supposed to work with a specific version of NationalInstruments.Common.dll, you should not try to make it work with another version by brute force. This will most probably result in errors. Better try to find two versions of those DLLs which belong together - for example, by asking the vendor. – Doc Brown Dec 21 '11 at 16:16

1 Answers1

3

Here

http://digital.ni.com/public.nsf/allkb/46DE00265283A71586256FC000797682

is a description of how to repair your installation, which should reinstall the two DLLs hopefully with versions belonging together.

If you really want to try to mix those DLLs together (which most probably won't work), read this former SO post, it explains the necessary steps:

Upgrade a reference dll in a C# project without recompiling the project

Community
  • 1
  • 1
Doc Brown
  • 19,739
  • 7
  • 52
  • 88
  • I created a third solution. I `ildasm` NationalInstruments.Common.dll changed the version in every place it appeared and then I `ilasm` it again. But I couldn't make it work either. – Jader Dias Dec 21 '11 at 18:10
  • @XMLforDummies: did you even try to contact the vendor, as I recommended? Your time would be much better invested in that task instead of trying to mix things together which probably cannot be mixed. – Doc Brown Dec 22 '11 at 06:59
  • Today when I turned on my computer the solution was compiling. Yay! Problem solved, but the FxCop warning is still there. – Jader Dias Dec 22 '11 at 11:08