Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arledesma/8b52a951b1bf0df02d1f3bdac59b6452 to your computer and use it in GitHub Desktop.
Save arledesma/8b52a951b1bf0df02d1f3bdac59b6452 to your computer and use it in GitHub Desktop.
Remove All AssemblyBindings from app.config files within source/$project/ and Add BindingRedirect to all projects in solution
# Run from within Package Manager Console
Get-Project –All | Add-BindingRedirect
Get-Item ./source/*/app.config | `
ForEach-Object {
$config = $_;
$xml = [xml](Get-Content $config);
if($xml.configuration -and $xml.configuration.runtime -and $xml.configuration.runtime.assemblyBinding) {
$xml.configuration.runtime.removeChild($xml.configuration.runtime.assemblyBinding);
$xml.Save($config)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment