Home

LinqPad custom plugin: extension method not found

Hi, first time poster here.
I've been trying to write a simple plugin for LinqPad (currently running v4.45.05 PRO), but LinqPad doesn't detect my extension methods.

I've written a simple VS project, which references LinqPad.AnyCPU, with one class which looks like this:

public static class Extensions
{
    public static void ShowCustomVisualization(this List<double> valueList)
    {
         var c = new CustomDisplay(valueList);
        PanelManager.DisplayWpfElement(c, "CustomDisplay");
    }
}
This project is built in Release mode, and copied to My Documents\LinqPad Plugins, which was created by LinqPad.
The project references another dll, which contains some logic for displaying, and that dll is also copied to the Plugins folder.

However, when I write a simple piece of code like this in LinqPad:
var d = new List<double>{1,2,3,4,5,6,7,8};
d.ShowCustomVisualization();
It does not find the extension method.

Yes, I've tried "turning it off and on again" :-) I've also tried to create different signatures for the extension method.

Doe anyone have any idea what I'm doing wrong?
Thanks!

Comments

  • Perhaps that class is defined in a namespace which will not have been imported. Have you tried removing the namespace?

    P.S. For simple visualizations, you don't need to use VS - just write your methods/types in the 'My Extensions' query.
  • edited May 2013
    Thank you for your answer! I removed the namespace, and now everything is working as expected, great! It was just not very clear from the documentation that the namespaces are important, maybe it is a point that you can add?

    I know I can also use the "My Extensions", but then it wouldn't be so easy to distribute right?

    Thanks again!
Sign In or Register to comment.