We have software that allows a user to choose at runtime which version of Microsoft Great Plains software they wish to integrate with, and as a result, which version of the Microsoft Econnect DLL we need to use to integrate for them. Our code does a lot of runtime investigation, and switches and loads the appropriate DLLs as necessary.
However, we must include ALL the DLLs in our solution so that they will be available at runtime, and including them all in the solution leads to MSB3277 warnings, namely:
warning MSB3277: Found conflicts between different versions of the same dependent assembly that could not be resolved. These reference conflicts are listed in the build log when log verbosity is set to detailed.
When looking at the log file generated in diagnostic mode, relevant lines are as follows:
29> There was a conflict between "Microsoft.Dynamics.GP.eConnect, Version=10.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" and "Microsoft.Dynamics.GP.eConnect, Version=11.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35".
29> "Microsoft.Dynamics.GP.eConnect, Version=10.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" was chosen because it was primary and "Microsoft.Dynamics.GP.eConnect, Version=11.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" was not.
29> References which depend on "Microsoft.Dynamics.GP.eConnect, Version=10.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" [C:\Development\Main\Tools\bin\GP10\Microsoft.Dynamics.GP.eConnect.10.dll].
29> C:\Development\Main\Tools\bin\GP10\Microsoft.Dynamics.GP.eConnect.10.dll
29> Project file item includes which caused reference "C:\Development\Main\Tools\bin\GP10\Microsoft.Dynamics.GP.eConnect.10.dll".
29> Microsoft.Dynamics.GP.eConnect.10
29> References which depend on "Microsoft.Dynamics.GP.eConnect, Version=11.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" [].
29> C:\Development\Main\Client\IntegrationModule\bin\Debug\GreatPlains2010Interface.dll
29> Project file item includes which caused reference "C:\Development\Main\Client\IntegrationModule\bin\Debug\GreatPlains2010Interface.dll".
29> C:\Development\Main\Client\IntegrationModule\bin\Debug\IntegrationModule.dll
29> C:\Development\Main\Client\IntegrationModule\bin\Debug\GreatPlainsInterface.dll
29> Project file item includes which caused reference "C:\Development\Main\Client\IntegrationModule\bin\Debug\GreatPlainsInterface.dll".
29> C:\Development\Main\Client\IntegrationModule\bin\Debug\IntegrationModule.dll
29>C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(1820,5): warning MSB3277: Found conflicts between different versions of the same dependent assembly that could not be resolved. These reference conflicts are listed in the build log when log verbosity is set to detailed.
I would like to suppress the warning for ONLY this conflict, as we resolve it ourselves at runtime, but allow any other conflicts that may arise (currently none) to issue this warning.
Is there any way to do this?
Alternatively, can someone who understand binding redirects better than I suggest a way we might avoid the warning in the first place?
Thanks in advance.
Years ago I had a similar problem; the only way (I found) to solve it was with a post-build command that copied the needed DLLs from a known location into your bin\ location. There's probably a better answer these days, though.