I use VCProjectEngine.dll, and there are 2 versions for Visual Studio 2010 and Visual Studio 2012.
I want to replace the DLL versions dynamically i would unload the old version, and then to load the new DLL.
I understood from this post that I can't unload DLL, but unload all domain.
So I try to unload the domain:
AppDomainSetup domaininfo = new AppDomainSetup();
domaininfo.ApplicationBase = System.Environment.CurrentDirectory;
Evidence adevidence = AppDomain.CurrentDomain.Evidence;
AppDomain domain = AppDomain.CreateDomain("MyDomain", adevidence, domaininfo);
AppDomain.Unload(domain);
and now I try to load the new DLL version:
AppDomain.CurrentDomain.Load(new AssemblyName("Microsoft.VisualStudio.VCProjectEngine, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"));
but it didn't help, Visual Studio 2012 doesn't know the VCProject type, because the old version is incorrect for it.
What's wrong in my code? or maybe there is other way to replace the DLL programmatically?