Tuesday, March 31, 2009

Error on saving Fiddler session as Visual Studio Web Test

A couple of days back, I used Fiddler to save a session as a Web Test and curiously got this error..
--------------------------
Error during save...
---------------------------
One or more plugins returned an error, but the remaining plugins executed and the WebTest was written.
---
Could not load file or assembly 'Microsoft.VisualStudio.QualityTools.WebTestFramework, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.

After going through this forum post, and modifying the Fiddler.exe.config file, I was able to save VSTS web tests using fiddler,

This was happening because, Fiddler was expecting Visual Studio 2005 assemblies and started complaining when it was not able to find them.

In order to work around this, we need to specify a binding redirect in the configuration file (fiddler.exe.config), so that the assembly resolver will resolve the 8.0 reference to the 9.0 assembly


<configuration>
<runtime>
<legacyUnhandledExceptionPolicy enabled="1" />
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Microsoft.VisualStudio.QualityTools.WebTestFramework"
publicKeyToken="b03f5f7f11d50a3a"
culture="Neutral" />
<bindingRedirect oldVersion="8.0.0.0"
newVersion="9.0.0.0"/>
<codeBase version="" href="C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\PublicAssemblies\Microsoft.VisualStudio.QualityTools.WebTestFramework.dll"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>