New version of classic Fiddler doesn't find type Fiddler.WebFormats,JSON.JsonDecode

1 Answer 110 Views
Fiddler Classic Windows
Dzmitry
Top achievements
Rank 1
Dzmitry asked on 01 Apr 2025, 04:43 PM

Today after upgrade Fiddler Classic to new version we got compilation error for our custom rules.

Fiddler version:

v5.0.20253.3311 for .NET 4.6.2
Built: Monday, March 31, 2025

64-bit AMD64, VM: 63.0mb, WS: 114.0mb
.NET 4.8 WinNT 10.0.22631.0

I don't see in release notes anything about FiddlerScript changes. So what need to be added now to resolve this issue?

Eric
Top achievements
Rank 1
commented on 01 Apr 2025, 08:41 PM

Telerik broke this in the latest version on purpose: https://feedback.telerik.com/fiddler/1683387-march-update-broke-fiddler-public-api

Your options are to either use one of the .NET Framework's built-in JSON parsers, or pull in a library compatible with the original yourself (you'd need to compile to a DLL): https://github.com/ericlaw1979/FiddlerImportNetlog/blob/master/FiddlerImportNetlog/JSON.cs

1 Answer, 1 is accepted

Sort by
0
Accepted
Jianxian
Top achievements
Rank 1
Iron
answered on 03 Apr 2025, 12:14 PM
Here's the code I've worked out that can be used

//@assembly Newtonsoft.Json
import Newtonsoft.Json.Linq;
//Place the above two lines of code at the top of the CustomizeRules.js

static function OnBeforeResponse(oSession: Session) {
	try {
		// Get response body JSON string
		var responseBody = oSession.GetResponseBodyAsString();
	
		// Use Newtonsoft.Json Parse JSON
		var jsonObject = JObject.Parse(responseBody);
		
		// Get some field in JSON
		var info = jsonObject["info"];
		FiddlerApplication.Log.LogFormat("The exist info: {0}", info);

		// Modify a field in the JSON
		jsonObject["message"] = "Some New String.";
	
		// Rewrite the modified JSON to the request body
		oSession.utilSetResponseBody(jsonObject.ToString());
	} catch (e) {
		FiddlerObject.alert("JSON Parse Failed: " + e.Message);
	}
}

Tags
Fiddler Classic Windows
Asked by
Dzmitry
Top achievements
Rank 1
Answers by
Jianxian
Top achievements
Rank 1
Iron
Share this question
or