LINQPad and Portable Deployments

LINQPad can be xcopied for portable or shared deployment, simply by copying the following runtime files:

LINQPad 5 LINQPad 7 LINQPad 8
LINQPad.exe
LINQPad.exe.config
LINQPad7-x64.exe
LINQPad7-x86.exe
LINQPad7-arm64.exe
LINQPad.GUI.dll
LINQPad.Runtime.dll
LINQPad8-x64.exe
LINQPad8-x86.exe
LINQPad8-arm64.exe
LINQPad.GUI.dll
LINQPad.Runtime.dll

No special setup is required. However, you may also wish to include queries, plugins, snippets, connections, drivers, default namespaces/references and user preferences with your deployment. Normally, queries, 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 LINQPad.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
         queries/                  -- Put your queries here
         plugins/                  -- Put your plugins + 'My Extensions' query 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 queries
         NuGetSources.xml          -- NuGet source settings
         NuGetConfig.xml           -- Additional NuGet config settings
         RoamingUserOptions.xml    -- User preferences
         ResultStyles.css          -- Custom result styling (LINQPad 5)
         ResultStyles.LINQPad7.css -- Custom result styling (LINQPad 7)
         ResultStyles.LINQPad8.css -- Custom result styling (LINQPad 8)
				

Query files

To include queries with your deployment, create a subfolder under the LINQPad.exe folder called queries. Any .LINQ files/folders that you put in here will now appear in the My Queries 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 queries 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 queries. You don't need to reference them explicity in the 'My Extensions' query.

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 queries 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, queries that rely on connections will still work, because the connection data is also reified in each .LINQ file.)

Default Namespaces/References for New Queries

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 queries'. 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 Sttings

NuGet package source and configuration settings (Query | 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).