How to use two different Microsoft Interop assemblies in one project?

I want to use two different assemblies of Microsoft.Office.Interop (versions 11 and 12) depending on the version of Office installed on the client machine.

I managed to add these two asseblies to my project (I use them loccaly - they are in my bin folder, in two different subfolders), I used aliases on these assemblies to be able to use both of them in my project (respectively, aliases - Excel11 and Excel12).

But unfortunately, when I try to create a solution, I get a warning:

Unable to resolve the conflict between "Microsoft.Office.Interop.Excel, Version = 12.0.0.0, Culture = neutral, PublicKeyToken = 71e9bce111e9429c" and "Microsoft.Office.Interop.Excel, Version = 11.0.0.0, Culture = neutral, PublicKeyToken = 71e9bce111e9429c " The choice "Microsoft.Office.Interop.Excel, Version = 12.0.0.0, Culture = Neutral, PublicKeyToken = 71e9bce111e9429c" is arbitrary.

+5
source share
1 answer

Yes, it's rude, but understandable. I highly recommend looking into the Open XML SDK for the non-COM generation. but I understand temporary crises and other requirements, so if you cannot ... that's what I will do.

, , http://www.dotnetperls.com/extern, - , , .

. , , - , Excel11, Excel12.

- , , , , . , , , , , . , .

0

All Articles