This is a migrated thread and some comments may be shown as answers.

Trouble with simple extension.

1 Answer 178 Views
Extensions and Customization
This is a migrated thread and some comments may be shown as answers.
John
Top achievements
Rank 1
John asked on 22 Apr 2016, 01:52 PM

Hi. Can anybody help me with simple extension. I am following fiddler's specification but even simple example wont work for me.

I did next steps:
1) Create new C# Class Library project
2) Put code from example in to the class1.cs
3) Compile Release version with Target framework.Net Framework 4.
4) Copy FiddlerTest.dll in to C:\Program Files (x86)\Fiddler2\Scripts directory and restart Fiddler.

After restart Fiddler Log tab doesn't contains my test messages. Also Extensions tab in the Fiddler option window shows only default extensions.

Fiddler version is v4.4.8.0, OS: Win 8.1 (64-bit).

Code:

01.using System;
02.using System.Windows.Forms;
03.using Fiddler;
04. 
05.[assembly: Fiddler.RequiredVersion("2.3.5.0")]
06. 
07.public class Violin : IAutoTamper
08.{
09.    string sUserAgent = "";
10. 
11.    public Violin()
12.    {
13.        sUserAgent = "Violin";
14. 
15.        FiddlerApplication.Log.LogString("Test message from custom extension");
16.    }
17. 
18.    public void OnLoad() {
19. 
20.        FiddlerApplication.Log.LogString("Test message from custom extension - method OnLoad");
21.    }
22.    public void OnBeforeUnload() {}
23. 
24.    public void AutoTamperRequestBefore(Session oSession)
25.    {
26.        oSession.oRequest["User-Agent"] = sUserAgent;
27.    }
28.    public void AutoTamperRequestAfter(Session oSession) { }
29.    public void AutoTamperResponseBefore(Session oSession) { }
30.    public void AutoTamperResponseAfter(Session oSession) { }
31.    public void OnBeforeReturningError(Session oSession) { }

Any suggestions?

1 Answer, 1 is accepted

Sort by
0
Tsviatko Yovtchev
Telerik team
answered on 27 Apr 2016, 03:02 PM
Hi,

Why don't you download the Image-Flipper extension from http://www.telerik.com/fiddler/add-ons? It is provided as an extension writing sample and comes with code. That should work out of the box for you. Then you can start modifying it step by step so that in the end it looks exactly like your sample here. That way you'll find the that single change that breaks things.

Regards,
Tsviatko Yovtchev
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Extensions and Customization
Asked by
John
Top achievements
Rank 1
Answers by
Tsviatko Yovtchev
Telerik team
Share this question
or