LINQPad and Portable Deployments

LINQPad can be xcopied for portable or shared deployment, simply by copying LINQPad.exe and LINQPad.exe.config. 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 LINQPad.exe and LINQPad.exe.config.

MyFolder/
         LINQPad.exe
         LINQPad.exe.config
         LPRun.exe               -- Include if you want command-line support
         LPRun.exe.config        -- 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 (LINQPad v5.21+)
         RoamingUserOptions.xml  -- User preferences

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.

(Localizing default namespaces/references is supported in LINQPad v5.06.02 and later.)

NuGet Source Settings

NuGet package source settings (Query | NuGet Package Manager > Settings) are normally stored in %AppData%\LINQPad\NuGetSources.xml. You can move/copy that file to the LINQPad directory to portablize it, if you're running LINQPad 5.21 or later.

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).