60

Is there a posibility to add a reference to an assembly in LINQPad?

I have some types in my assembly and I would like to use them in my LINQPad queries.

poke
  • 369,085
  • 72
  • 557
  • 602
miron
  • 611
  • 1
  • 5
  • 4

4 Answers4

104

Just press F4.

This will pop up the Add Reference dialog.


Add reference to linqpad

sloth
  • 99,095
  • 21
  • 171
  • 219
  • Do you need to add the namespace or a using statement as well? – surfmuggle Oct 25 '16 at 17:37
  • 3
    @surfmuggle yes, in the query properties window, shown in the answer there is a second tab "Additional Namespace Imports" where the namespaces need to be added. If you add the using statements in the query, linqpad will prompt you to move them there. – MEC Nov 09 '16 at 20:30
7

You can also use the menu option to access the popup window to add references.

  • Notice the >> arrows in menu bar. Click on it.

  • Go to Query menu. Find References and Properties. Click on it.

Following is example image from LINQPad 5:

enter image description here

SSD
  • 1,373
  • 2
  • 13
  • 20
5

This doesn't apply to your case but may be helpful for others that had the same issue as me. My issue was with a "missing" system type (Task<T>) since LinqPad didn't had the using it by default. One way to add it on LinqPad is pressing F4 > Namespace Imports tabs and adding at the bottom of the list System.Threading.Tasks then press Ok.

You can also set this new list as the default for the new queries pressing Set as default for new queries

Go by shortcut

Other way to access this tab is by the top menu Query > Namespace Imports

Go by the query menu

Luxant
  • 141
  • 1
  • 7
-5

I had to do fn and F4 at the same time.

Robert Columbia
  • 6,313
  • 15
  • 32
  • 40
thedanotto
  • 6,895
  • 5
  • 45
  • 43