Fiddler 4 comes with a C# source file ({MyDocuments}\Fiddler2\Scripts\CustomRules.cs
) for writing custom traffic routing rules.
That file is suggested to be edited using either Fiddler's ScriptEditor, Visual Studio or Visual Studio Code.
Opening the file in any of these editors doesn't provide code completion for the provided event handlers' parameters. That's because IntelliSense doesn't know where to take the objects' information from.
It's hard to program against Fiddler's custom objects if I don't know these objects' properties or methods. So, I wonder how to enable IntelliSense for that file.
The file begins with a reference to a Fiddler
assembly:
using System;
using Fiddler;
...
Since the Fiddler.dll
assembly is not in the GAC, IntelliSense is unable to retrieve the corresponding objects' information.
From JavaScript I know there is a reference
comment tag available that enables IntelliSense to find missing type information by providing it a path to a JavaScript file containing the missing type definition:
/// <reference path="Utilities.js" />
Is there something similar available for .NET?
I would be looking for something like:
using System;
using Fiddler; /// <reference path="C:\Program Files\Telerik\Fiddler\Fiddler.dll" />
Is there something similar available for .NET?
In fact, there is no such way, tool to get the Intellisense of a .Net assembly without instantiating its object or using its namespace directly.
.NET assmebly
is different from Javascript front-end files and has a tight encapsulation, so if your wishes can be achieved, this is a serious violation of .Net rules.
It is for this reason that in .Net, there is no way to obtain Intellisense similar to Javascript.
And to obtain the Intellisense of the .Net assembly, it is actually referring to the dll.
Here, it is impossible to get rid of referencing Fiddler.dll
by project or instantiating its object and extract the Intellisense among them. This is also a security consideration for the .net project.
So the best solution to obtain the intellisense of .Net assembly is that:
1) Right-click on your project-->Add Reference
to this Fiddler.dll
2) using its namespace in code editor.