How to add a reference to an assembly in LINQPad to access custom types?

.NetLinqpad

.Net Problem Overview


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.

.Net Solutions


Solution 1 - .Net

Just press F4.

This will pop up the Add Reference dialog.


Add reference to linqpad

Solution 2 - .Net

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

Solution 3 - .Net

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

Solution 4 - .Net

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

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionmironView Question on Stackoverflow
Solution 1 - .NetslothView Answer on Stackoverflow
Solution 2 - .NetSSDView Answer on Stackoverflow
Solution 3 - .NetLuxantView Answer on Stackoverflow
Solution 4 - .NetthedanottoView Answer on Stackoverflow