LINQPad and Portable Deployments
LINQPad can be xcopied for portable or shared deployment, simply by copying the following runtime files:
| LINQPad 5 |
LINQPad 9 |
LINQPad.exe LINQPad.exe.config |
LINQPad9-x64.exe LINQPad9-x86.exe LINQPad9-arm64.exe LINQPad.GUI.dll LINQPad.Runtime.dll |
No special setup is required.
However, you may also wish to include scripts, plugins, snippets, connections, drivers, default namespaces/references and user preferences with your deployment.
Normally, scripts, plugins, snippets are stored in folders under My Documents, and everything else is stored in AppData\LINQPad.
However, if you create specially named subfolders under where you've put LINQPadx.exe, those local folders will be used for this data instead.
Here's a summary of a portable deployment. All items are optional apart from runtime files.
MyFolder/
(runtime files)
LPRun.exe.* -- Include if you want command-line support
scripts/ (or queries/) -- Put your scripts here
plugins/ -- Put your plugins + 'My Extensions' script here
snippets/ -- Put custom snippets here
drivers/ -- Put custom drivers here
ConnectionsV2.xml -- Connections to populate Schema tree view
DefaultQuery.xml -- Default namespaces/references for new scripts
NuGetSources.xml -- NuGet source settings
NuGetConfig.xml -- Additional NuGet config settings
RoamingUserOptions.xml -- User preferences
ResultStyles.css -- Custom result styling (LINQPad 5)
ResultStyles.LINQPad8.css -- Custom result styling (LINQPad 8)
ResultStyles.LINQPad9.css -- Custom result styling (LINQPad 9)
Script files
To include scripts with your deployment, create a subfolder under the LINQPad.exe folder called scripts or queries. Any .LINQ
files/folders that you put in here will now appear in the My Scripts tree view (in place of My Documents/LINQPad Queries.
This can be useful when deploying LINQPad to a corporate intranet, where you want to present users with a set of queries they can run.
Extensions and Plugins
If your scripts depend on My Extensions, you can ship this, too. Create a subfolder under the LINQPad.exe folder called
plugins and then move/copy the content of My Documents/LINQPad Plugins into here. Note that any DLLs in this folder are
automatically referenced by all scripts. You don't need to reference them explicity in the 'My Extensions' script.
Custom Code Snippets
If you have any custom code snippets in My Documents/LINQPad Snippets, you can localize this too, by creating a folder
under LINQPad.exe called snippets and copying/moving your snippets there.
Custom Data Context Drivers
Custom and downloaded data context drivers are normally stored in %LocalAppData%\LINQPad\drivers. If your scripts or connections rely
on drivers that are not built-in, you can copy or move this folder into a local folder called drivers.
Connections
The connections that appear in the tree view when you start LINQPad are normally stored in %AppData%\LINQPad\ConnectionsV2.xml.
If you move/copy this file into the folder where LINQPad.exe is located, the latter will take precedence. If it's a shared
location, you can make it read-only to prevent consumers from persisting changes.
(If you choose not to include the ConnectionsV2.xml file, scripts that rely on connections will still work, because the connection
data is also reified in each .LINQ file.)
Default Namespaces/References for New Scripts
LINQPad lets you select a default set of namespace imports and assembly references by going to 'References and Properties' (F4)
and pressing 'Set as default for new scripts'. The result is normally stored in %AppData%\LINQPad\DefaultQuery.xml.
If you move/copy this file into the folder where LINQPad.exe is located, the latter will take precedence. If it's a shared
location, you can make it read-only to prevent consumers from making changes.
NuGet Source and Config Settings
NuGet package source and configuration settings (Script | NuGet Package Manager > Settings) are normally stored in %AppData%\LINQPad\NuGetSources.xml
and %AppData%\LINQPad\NuGetSources.xml. You can move/copy those files to the LINQPad directory to portablize it.
User Preferences
User preferences such as tab size and editor color are normally stored in %AppData%\LINQPad\RoamingUserOptions.xml.
You can move/copy that file to the LINQPad directory to portablize it (not recommended for shared use scenarios).