Building Extension assemblies to run in both Fiddler v2 and v4
If you want your extension Assembly to run in both Fiddler2 and Fiddler4, build it for .NET Framework v2 and avoid taking any dependencies on any classes that were removed or moved in the later version of the Framework. (The only instance I'm aware of is the Microsoft JScript.NET code compiler, whose classes were moved around a bit).
You'll also need to ensure that if you use any methods that are deprecated (e.g. calling with the overload that takes an Evidence parameter) you do so only conditionally. E.g.
All of the extensions from the Fiddler website are compiled against Fiddler v2.
Alternatively, you can simply build two versions of your DLL, one version targeting .NET Framework v4 and one targeting .NET Framework v2,
This is how Fiddler itself is built. Basically, just add a "clone" version of your v2-targeted Project to the same Solution. Use the -> context menu to add the .CS files from the v2-targeted project to the v4-targeted project-- but when selecting the files, be very sure to use the split button on the file picker dialog and choose On the v4 Project's tab, add a like . You can then put any .NETv4-specific code behind conditional compilation...
Your extension may install the appropriately-targeted version based on the content of the registry key found inside
The .NET2 version of Fiddler is more popular than the .NETv4 version at this time. When the .NET Framework v4.5 is released, I move the v4 project over to v4.5. Among other things, that would allow me to take advantage of the new built-in .ZIP classes in that later framework.
What about the RequiredVersion attribute?
Fiddler v4 is "smart"-- if your extension specifies
When Fiddler v4 loads it, it will require version 220.127.116.11 or later.
©2018 Eric Lawrence