Last active
April 3, 2017 20:12
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Run from within Package Manager Console | |
Get-Project –All | Add-BindingRedirect |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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