0

I have that code snippet
var manager = Package.GetGlobalService(typeof (SVsExtensionManager)) as IVsExtensionManager;
to handle my VSIX package update and I'm using the Microsoft.VisualStudio.ExtensionManager namespace and importing the appropriate Dll for it. However, there are two verions of that dll, one for VS2012 and the other for 2013. Is there a way to use both of Dlls within the same code and test if the opened instance of Visual Studio is 2012 or 2013 to figure out which dll to use? I tried to use external alias but it seems not to be working.
Your help is much appreciated.

Ldh
  • 31
  • 1
  • 1
  • 5
  • Does your DLL linked statically (in VS dependencies) or dynamically (in code) – Rami Yampolsky Aug 18 '15 at 13:23
  • @RamiYampolsky do I have to link them dynamically? You mean using Reflection ? – Ldh Aug 18 '15 at 17:21
  • If you link statically, then just replace the dll on the disk according to your VS version. If dynamically then you can programaticaly load any of them depending on command line parameter, which may be VS version – Rami Yampolsky Aug 18 '15 at 19:39
  • Sorry, but statically, that could not be a solution for me. how about loading them dinamically? Do you have an good example of how to proceed please? – Ldh Aug 19 '15 at 17:20
  • Check this simple answer: http://stackoverflow.com/questions/18362368/loading-dlls-at-runtime-in-c-sharp – Rami Yampolsky Aug 20 '15 at 06:09

0 Answers0