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

How to use HtmlAgilityPack in Fiddler Script?

4 Answers 288 Views
Windows
This is a migrated thread and some comments may be shown as answers.
chen
Top achievements
Rank 1
Iron
Iron
Iron
chen asked on 14 Jan 2020, 12:48 PM

Fiddler Script now support C#. I'm try to use HtmlAgilityPack in Fiddler Script by " using HtmlAgilityPack; " . See 1.png;

It shows an error .  See 2.png;

I'm try to change version of HtmlAgilityPack but it still same error.

Could some one help me how to fix this error? Thanks so much.

4 Answers, 1 is accepted

Sort by
0
chen
Top achievements
Rank 1
Iron
Iron
Iron
answered on 15 Jan 2020, 01:53 AM

The verson of Fiddler is V5.0.20194.41348.

I alread reference HtmlAgilityPack.dll in options Scripting .

See 1.png.

0
Boby
Telerik team
answered on 21 Jan 2020, 08:00 AM

Hi Chen,

What is the translation of the error message? Make sure that you are using HtmlAgilityPack compatible with the .NET Framework version used by Fiddler (Fiddler have .NET Framework 4, 4.5, and 4.6.1 flavors).

Regards,
Boby
Progress 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
0
chen
Top achievements
Rank 1
Iron
Iron
Iron
answered on 22 Jan 2020, 04:47 PM

Thanks so much for reply. The translation of the error message is 

Could not load file or assembly "HtmlAgilityPack, Version=1.11.17.0,Culture=neutral,PublickeyToken=bd319b19eaf3b43a" or one of its dependencies.system cannot find file specified.

 

The code i use in Fiddler Script is

    HtmlAgilityPack.HtmlDocument doc = new HtmlAgilityPack.HtmlDocument();

and I download HtmlAgilityPack at this url https://www.nuget.org/packages/HtmlAgilityPack/ 

Maybe  you can try download HtmlAgilityPack and reference in Fiddler see does it work?

Thank again for reply.

Best regards.

0
Boby
Telerik team
answered on 27 Jan 2020, 03:55 PM

Hi Chen,

You are right, I managed to reproduce the issue, but I am not sure what it causing the issue as of now. 

What I've noticed is that using JScript.NET seemingly works around the problem. I logged issue on your behalf, which you can follow to get notifications about potential fixes:

Some third-party libraries cannot be added as references in FiddlerScript when scripting language is C# 

Regards,
Boby
Progress 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
Windows
Asked by
chen
Top achievements
Rank 1
Iron
Iron
Iron
Answers by
chen
Top achievements
Rank 1
Iron
Iron
Iron
Boby
Telerik team
Share this question
or