Created
August 26, 2014 09:25
-
-
Save codito/71748b015f61c17a85ef to your computer and use it in GitHub Desktop.
Script to update assembly bindings to support 3rd party test adapters in Visual Studio Test Platform
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
# | |
# Script to update assembly bindings to support 3rd party test adapters in Visual Studio Test Platform | |
# Applies to VS 2014 CTP 3 bits | |
# Needs to run as Admin, please use it at your own risk | |
# | |
function Update-AssemblyBinding($configFile) | |
{ | |
Write-Host "Updating $configFile" | |
[xml] $config = Get-Content $configFile | |
$config.configuration.runtime.assemblyBinding.dependentAssembly | % { | |
if ($_.assemblyIdentity.name.StartsWith("Microsoft.VisualStudio.Test")) | |
{ | |
$_.bindingRedirect.oldVersion = "11.0.0.0-12.0.0.0" | |
} | |
} | |
$tempFile = [System.IO.Path]::GetTempFileName() | |
Write-Host "... Using temp file: $tempFile" | |
$backupFile = $configFile + ".orig" | |
Write-Host "... Backup $configFile -> $backupFile." | |
Copy-Item $configFile $backupFile | |
$config.Save($tempFile) | |
Copy-Item $tempFile $configFile | |
Write-Host "... Updated $tempFile -> $configFile." | |
} | |
if ($env:VS140COMNTOOLS -eq $null) | |
{ | |
Write-Host "VS 2014 is not installed." | |
} | |
else | |
{ | |
$testWindowPath = $env:VS140COMNTOOLS + "..\IDE\CommonExtensions\Microsoft\TestWindow\" | |
Push-Location $testWindowPath | |
Write-Host "Working directory: $testWindowPath" | |
Update-AssemblyBinding "vstest.console.exe.config" | |
Update-AssemblyBinding "vstest.discoveryengine.exe.config" | |
Update-AssemblyBinding "vstest.discoveryengine.x86.exe.config" | |
Update-AssemblyBinding "vstest.executionengine.clr20.exe.config" | |
Update-AssemblyBinding "vstest.executionengine.exe.config" | |
Update-AssemblyBinding "vstest.executionengine.x86.clr20.exe.config" | |
Update-AssemblyBinding "vstest.executionengine.x86.exe.config" | |
Pop-Location | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Here's the manual workaround.
Modify assembly bindings for
Microsoft.VisualStudio.Test*
assemblies in the *.exe.config files in $env:VS140COMNTOOLS + "..\IDE\CommonExtensions\Microsoft\TestWindow"Before
After