Add-BindingRedirect automation

Topics: Ecosystem, General
Feb 12, 2013 at 11:35 AM
Currently I am installing a package using this code:
var componentModel = GetGlobalService(typeof(SComponentModel)) as IComponentModel;
var installer = componentModel.GetService<IVsPackageInstaller>();
installer.InstallPackage(packageSource, project, packageId, packageVersion, false);
However, this does not behave exactly the same way as installing package manually. One has to execute this:
to get the same effect. But how do I execute this command from my VsPackage. Or, alternatively, how do I get it executed during package installation?
Feb 15, 2013 at 12:39 PM
the binding redirect should happen automatically with you code. Are you certain that a binding redirect should take place in your case? What are the packages you are trying to install?
Feb 15, 2013 at 9:24 PM
I agree that it should, but it does not. When I install the package using automation the application does not start because of references to different versions of assemblies. When I create the same solution, but install the packages manually then the binding redirects appear in web.config and application starts correctly. The packages are our internal and not (yet) available on
Feb 17, 2013 at 3:11 PM
Can you describe to me what assemblies the packages contain and what are the relationship between them? What how are they installed into the projects?
Feb 18, 2013 at 9:32 AM
Edited Feb 18, 2013 at 9:34 AM
Not sure this is exactly the information you expect but let me try:

OpenWaves (
OpenWaves.EPiServer.ImageProperty (; dependencies: OpenWaves.ImageTransformations.EPiServer (>=
OpenWaves.ImageTransformations (; dependencies: OpenWaves (>=
OpenWaves.ImageTransformations.EPiServer (; dependencies: OpenWaves.ImageTransformations.Web (>=, OpenWaves (>=
OpenWaves.ImageTransformations.Web (; dependencies: OpenWaves.ImageTransformations (>=, OpenWaves (>=
OpenWaves.Web (; dependencies: OpenWaves (>=

The solution does not work without binding redirects for OpenWaves and OpenWaves.Web.