my extension folder instead of a single query file.
My "my extension" is so bloated now. It has so many classes and methods now. I would like to separate them to individual files (class level) and store them in a specific folder ("My Extensions" folder?) and then all the classes and method will appear in all other queries.....
On a larger level, this brings the concept of projects (or solution). Perhaps we can extend this idea to have a folders marked as a projects, so when running queries this will build all the queries in that folder to same assembly so that it is possible to call methods from other linq files in the same folder.
-
Tok commented
I totally agree about the split of "My Extensions" into several files.
Be aware that my file doesn't contain any domain specific stuff but only several tools I often use in LinqPad (and often update, refactor so I don't want them to be statically compiled in a VS project).I'm not sure about the "project" concept, it don't feel it is the use case of LinqPad (in fact, not my use case).
-
Also note that any DLL that you put into LINQPad's "plugins folder" (Edit | Preferences | Folders) will be automatically referenced by all queries.
So if you want every query to automatically reference multiple extension assemblies, you can completely do so if you build those extensions in VS.
-
Alan Hemmings commented
A better solution if the myextension is becoming large, is to move the non domain specific stuff into a utility dll using visual studio, then reference that dll from any script that needs the extended functionality. Also, if you have different projects that require different types of "shared utilities" then include an xcopy (copy) of linqpad in your tools folder of your solution, and create subfolders under each project (each code base) with the project specific extensions you require.
The only slight downside with this approach is (I think) you will lose the ability to simply double click a linqpad script to launch linqpad, as that will launch the version of linqpad (in it's installed location and it's own extensions) rather than the specific version for each project.
If you're using linqpad as some type of build tool, then you can get your ps scripts or batch files to run the linqpad scripts using lprun, i.e. run the specific version of linqpad in your solutions tools folder, so that all the paths and extensions are correct (for that specific solution).
;-D