Download LINQPad 7

LINQPad 7 supports C# 11 and targets .NET 7, .NET 6, .NET 5 and .NET Core 3.1.
(For .NET Framework support, run LINQPad 5 side-by-side.)

Download LINQPad 7 - RTM

Download LINQPad 7 - Latest Beta

See beta release notes

X64 + X86 + ARM64 (Windows)

Release Notes

To enable paid features of LINQPad 7, you will need to upgrade your license to Version 7 if you purchased an older major version (such as version 6 or version 5). A LINQPad 7 license also works for all previous versions of LINQPad.

LINQPad 7.5

New Features

  • LINQPad now lets you benchmark code with a single keypress! Simply select the code you want to benchmark, and press Ctrl+Shift+B. LINQPad uses the industrial-grade BenchmarkDotNet library as the underlying engine, while providing a customizable real-time graphical display of results. For a complete tutorial, press Ctrl+F1 and type benchmark.
  • LINQPad now supports the latest .NET 7 and its EF Core driver supports the latest EF Core 7 builds.
  • Util.Cache now has an overload that forces a refresh of the cached item.
  • Dump now automatically dereferences pointers to structs, after performing a memory integrity check.
  • LINQPad's logic for setting column widths in data grids has improved.
  • The "Replace All" editor command is now faster with large documents.
  • There's a new "Cancel and Execute" command on the query menu (Shift+Alt+X), to cancel and re-run a query in one step.
  • The charting extension methods are now accessible from script that execute via lprun.
  • LINQPad's C# 11 samples have been updated with the latest new language features.
  • The selected query tab is now rendered more clearly in Windows 11, and the drag-to-reorder mechanism is smoother.
  • The vi emulator now supports the cc command. There's also now an option in Edit | Preferences to automatically enter View mode when making a selection with the mouse or arrow keys, and options to globally remap the CapsLock key.
  • LINQPad now monitors the computer's Edge Chromium (WebView2) installation via a FileSystemWatcher, and re-initializes on the fly when it detects changes, updates or anomalies. It also now switches to the retail Edge installation dynamically when WebView2 throws a FileNotFoundException or is unable to initialize.
  • LINQPad's interactive authentication engine for SQL Azure now uses the latest MSAL libraries. You can also access LINQPad's new authentication engine programmatically - by calling Util.MSAL.AcquireTokenAsync and Util.MSAL.AcquireTokenByUsernamePasswordAsync. These methods are useful when connecting to the Azure Management API, Azure Key Vault, and other OAuth endpoints. For interactive demos (including Key Vault), press Ctrl+F1 and type azure.
  • To make working with Azure easier, LINQPad now includes the Util.AzureCloud helper class, which exposes authentication, Management API and Azure SQL endpoint constants for each of the Azure clouds.
  • There's a new tab in the NuGet Settings dialog (from the NuGet Package Manager) with options to reduce prompting when downloading and restoring packages.

Fixes

  • Observables that fault now render the exception correctly when dumped.
  • The NET5/NET6/NET7 symbols are now generated and honored correctly.
  • You can now copy text containing emojis or non-BMP characters from the editor to the clipboard without error.
  • LPRun now correctly restores missing NuGet packages when previously available packages are deleted from the cache.
  • The "Go to Definition" menu item now displays correctly when enabled.
  • A bug in the data type mapping logic for Oracle tables, whereby columns in a relationship would sometimes be mapped incorrectly to decimal, has been fixed.
  • The vi emulator's ci{ command now positions the cursor favorably, and an intermittent problem in the implementation of 'kj' to escape insertion mode has been fixed.
  • End-of-line semantic parsing errors, such as missing semicolons, now generate red squigglies.
  • Native disassembly now works reliably with older .NET runtimes.
LINQPad 7.4

New Features

  • Referencing the Windows SDK libraries for Windows 10 and 11 is now supported via a checkbox in the Query Properties dialog. This feature is also activated implicitly when a package in the NuGet dependency graph indicates a framework dependency on Windows 10 or Windows 11. This avoids the assembly resolution errors that might otherwise result, and obviates the need to reference Microsoft.Windows.SDK.NET.ref.
  • LINQPad's startup time has been improved though parallel initialization and early JITing.
  • You can now edit credentials in the NuGet Package Manager Source Settings dialog without needing to restart LINQPad.
  • The "Copy assemblies into local folder" option in Query Properties now also copies native libraries. There's also a new option to copy native and platform-specific files into a runtimes\ subdirectory.
  • There's now a keyboard shortcut (Alt+Shift+Minus) to restore NuGet packages. LINQPad will also now restore packages automatically (without prompting) when opening queries, connections or switching framework versions, if the package has already been downloaded for another .NET version.
  • LINQPad's ability to display syntax-highlighted text has been improved with the new Util.SyntaxColorText method. This allows you to dump syntax-highlighted text to the main results window (as well as a separate panel):
    Util.SyntaxColorText (csharp, SyntaxLanguageStyle.CSharp).Dump();            // Dump inline
    Util.SyntaxColorText (json,   SyntaxLanguageStyle.Json)  .DumpToNewPanel();  // Dump to separate panel
    
    You can also ask LINQPad to perform auto-formatting with the autoFormat argument (this works with C#, VB, XML and JSON).
  • The assembly resolution log in Query Properties > Advanced now includes an interactive NuGet dependency graph.
  • When connecting to custom EF Core contexts, LINQPad now recognizes when you apply the [System.ComponentModel.Category] attribute to DbSet properties and groups tables accordingly.
  • The Util.ToExpando method now has an includePrivate option to include non-public properties and fields.
  • Observables with many rows now render more efficiently.
  • When you copy text from the editor, LINQPad now populates the clipboard with HTML-based syntax-highlighted text that can be pasted into web-based mail apps as well as Office applications. Resolved symbol markup is also now included.
  • The debugger's Call Stack window now shows unwinding stack frames in green, when stepping through exception blocks.
  • There's now an option to disable executing selected code in Edit | Preferences > Advanced. (You can then use Alt+Shift+F5 to execution a selection.)
  • Calling Environment.Exit(0) now terminates the query process without generating an error message.
  • LINQPad's HTML controls are now faster and more robust.
  • Autocompletion on object initializers and with expressions has improved.
  • The LINQPad.Controls namespace now includes an IFrame control for dumping complete HTML documents or web sites inline.
  • LPRun now automatically restores EF Core dependencies if required.

Fixes

  • The debugger now steps correctly through catch and finally blocks.
  • Util.Pivot now works correctly when expanded from a hyperlink.
  • The tooltips for null-valued booleans now display correctly in data grids.
  • The .NET downloader utility now works with default proxies.
  • DateOnly and TimeOnly types can now be used as primary keys in LINQPad's LINQ-to-SQL implementation.
  • LINQPad's editor now performs well when #loading large Program-type queries.
  • Results exported as HTML now include functioning expand/collapse buttons.
  • Queries called via Util.Run that return short numeric types now serialize correctly.
  • The lambda translation tab now resets correctly before execution when previously unshown.
  • A subtle issue whereby LINQPad would sometimes see a framework-specific package dependency as invariant when resolving NuGet package dependency graphs has been fixed.
  • When a NuGet restoration condition is detected by a background process, the prompt dialog now executes additional steps to ensure that it doesn't disappear behind LINQPad's main window.
  • LINQPad's built-in EF Core scaffolder now emits numeric precision metadata for decimal types to avoid potential rounding errors.
  • A bug in Amazon EC2 VM recognition when activating LINQPad has been fixed.
  • A syntax highlighting bug that would manifest with queries that include explicit using directives has been fixed.
  • LINQPad's SQLite driver now correctly infers boolean types for tables with no rows.
LINQPad 7.3

New Features

  • Queries can now target the .NET 7.0 preview. The EF Core drivers have also been updated to support the EF Core 7 preview.
  • You can now play with the latest experimental C# 11 features: go to Edit | Preferences > Query and enable Use C# Preview Features and Use Roslyn Daily build.
  • You can now define a static ToDump method in any query (not just in My Extensions). This also includes queries that you #load: each can have its own static ToDump method.
  • You can now call Util.WithStyle on numeric values without losing right-aligned formatting and automatic graphing in tables. There's also a new Util.WithCssClass method to specify a CSS class.
  • The maximum editable length for text fields in SQL databases (when editing data interactively) has been increased to 60,000 characters.
  • The NuGet Package Manager Source Settings dialog now lets you specify an authentication type. Specifying Basic forces basic authentication, which improves reliability when connecting to Azure Devops feeds with a Personal Access Token. There's also a new option to use default Windows credentials.
  • The Find dialog now works with SQL translation text, too. Just focus the control and use the standard menu options or shortcut keys (Ctrl+F, F3, Shift+F3 and Ctrl+I).

Fixes

  • A memory leak when working with F# queries has been fixed.
  • An error when generating typed data contexts that include C# keywords - for users in countries with non-English A-Z letter ordering - has been fixed.
  • LINQPad has been hardened against intermittent errors in the WebView2 (Edge Chromium) engine.
  • A bug where DumpContainers and Tasks sometimes failed to update in inactive queries has been fixed.
  • A race condition in Util.HtmlHead.AddScriptFromUri that could result in empty output has been fixed.
  • The LINQ-to-SQL connection option to include system objects now works with the master database as well.
  • Grouped observables with compound keys now display correctly when dumped.
  • A focus management issue with the latest WebView2 results rendering engine has been fixed.
LINQPad 7.2

New Features

  • LINQPad now actively monitors NuGet package references and dependencies for published vulnerabilities and gives warnings - both when choosing packages and executing queries. You can suppress warnings for specific (or all) packages in Edit | Preferences > Advanced > Execution. Packages whose content will be overridden by the runtime or another package are automatically ignored.
  • There are two new methods in the Util class to shape data before dumping. Util.Pivot swaps rows and columns before dumping sequences and objects (and 2-dimensional arrays):
    Util.Pivot (allCustomers).Dump();
    Util.Pivot (myCustomer).Dump();
    Util.Merge merges the properties of two or more objects into one. It's particularly handy when you want to add extra columns to the output of a LINQ query:
    from il in InvoiceLines
       select Util.Merge (
          il,
          new { il.Invoice.InvoiceDate, il.Track.Composer });   // Adds two columns to the InvoiceLine object
    
    Refer to LINQPad's help (Ctrl+F1) for more examples.
  • There's now an Image HTML control in the LINQPad.Controls namespace. This supports the same image source and scaling options as Util.Image, so you can pass in a URI, filename, System.Drawing.Image, or byte array.

Fixes

  • F# queries that use the FSharp.Data NuGet package should now work correctly.
  • A condition that could cause an assertion failure when using the LINQ-to-SQL driver has been fixed.
  • An ASP.NET assembly resolution error that appeared when connecting to your own assemblies in the EF Core dialog has been fixed.
  • The command-line runner now returns 1 if a script fails. You can also return a non-zero value to LPRun7 by returning an int in the Main method - or by setting Environment.ExitCode.
  • Completed tasks now honor the ToDump pipeline.
  • DateOnly and TimeOnly types can now be used as primary keys in LINQPad's LINQ-to-SQL implementation.
  • LINQPad can now reliably locate the reference assemblies in the .NET 6.0.1 SDK, avoiding the prompt for a NuGet download.
  • String concatenation now works correctly in LINQPad's Watch debugger window.
  • LINQPad's editor now recognizes the unmanaged and notnull type constraints in syntax highlighting.
  • LINQPad's Locals and Watch debug windows now correctly expose lambda-captured variables in asynchronous functions.
LINQPad 7.1

New Features

  • LINQPad 7 now supports F# 6.
  • Connections configured for .NET 6.0 now always use the requested framework if available, regardless of your default framework choice. This avoids compilation errors that might otherwise result.
  • Util.Dif's text diffing is now more aggressive in looking for differences when comparing single-line strings.
  • The MySQL and PostgreSQL drivers have been updated to .NET 6.0.
  • When dumping structs, LINQPad now descends into fixed-length buffers.

Fixes

  • The CMD symbol now works correctly when running scripts with LPRun7.
  • Queries with the "Reference LINQ-to-SQL" checkbox enabled should now work with the right assemblies.
  • When dumping a DataTable in DataGrid mode, an icon now appears when a RowError property is set.
  • A startup error that was affecting some users has been fixed.
  • A number of edge-cases that could cause the auto-generated LINQ-to-SQL data context not to compile have been fixed.
  • A package restoration error that sometimes appeared when enabling spatial types in the EF Core dialog has been fixed.
  • If .NET 6 hasn't been installed, EF Core connections will use EF Core 5 instead of EF Core 6.
  • An intermittent error that sometimes appeared when restoring NuGet packages from a local source has been fixed.
LINQPad 7

Deployment

LINQPad 7 requires at least one of the following runtimes:

  • .NET 6 (Desktop) - RC1 or later
  • .NET 5 (Desktop)
  • .NET 3.1 (Desktop)

If none of these have been installed, LINQPad will bootstrap the installation of .NET 6. If multiple runtimes have been installed, you can choose which to use on a per-query basis via a dropdown in the toolbar. (You can also set a global default in Edit | Preferences.)

.NET Core 3.0 is no longer supported.

The xcopy-deployable version of LINQPad 7 ships with the following launchers:

LINQPad7-x64.exe    // for X64
LINQPad7-x86.exe    // for X86 - choose this if you need to reference native 32-bit DLLs
LINQPad7-arm64.exe  // for ARM64 machines such as Surface Pro X

It is recommended that you rename/copy the launcher that corresponds to your native platform to LINQPad7.exe.

LINQPad's launchers are custom CLR hosts. This allows them to bind the host to the optimum .NET version, and bootstrap the installation of .NET if no suitable version has been installed.

Launchers for Command-Line Support

LINQPad also ships with special new launchers for executing queries via the command-line:

LPRun7-x64.exe    // X64
LPRun7-x86.exe    // X86
LPRun7-arm64.exe  // ARM64

It is recommended that you rename/copy the launcher that corresponds to your native platform to LPRun7.exe (the RTM installer will do this for you automatically).

These are also custom CLR hosts and include logic on the unmanaged side to determine which .NET version to spin up (new to LINQPad 7). Instead of looking for a .runtimeconfig.json file, the command-line launchers locate and examine the .linq query that you want to run. If you chose a specific .NET version in the toolbar when you wrote the query, this will have been saved to the .linq file, and this choice will be honored. Otherwise the launcher parses the user-preferences file for your default framework choice.

You can also specify/override the .NET version with LPRun7's -fx switch:

LPRun7 -fx=6.0 (query-to-run)   // Run query under .NET 6.0
LPRun7 -fx=5.0 (query-to-run)   // Run query under .NET 5.0
LPRun7 -fx=3.1 (query-to-run)   // Run query under .NET 3.1

ARM64 Support

LINQPad 7 natively supports the Windows ARM64 platform, for an optimized development experience on ARM64 laptops. This includes LINQPad's debugger, which has been fully updated with ARM64 offsets and registers, so you can debug scripts just as you would on X64/X86 machines.

EF Core 6.0

LINQPad 7 supports Entity Framework Core 6.0 (as well as older versions, down to 3.0). LINQPad's EF Core driver understands the compatibility matrix between versions/subversions of .NET and EF Core, and if necessary, will switch your query to the closest compatible .NET version (with a warning).

LINQPad 7's EF Core drivers no longer support EF Core 2.x - the minimum supported version is now EF Core 3.

DateOnly and TimeOnly Types

.NET 6 includes DateOnly and TimeOnly types to represent just a date or time. In LINQPad 7, you can control the default fomatting for these new types in Edit | Preferences > Results.

Additionally, LINQPad's internal implementation of LINQ-to-SQL has been updated to support DateOnly and TimeOnly, so you can now have a perfect mapping for SQL Server's date and time types. To ensure backward compatiblity, this feature is disabled on existing connections by default; to enable, tick the checkbox in the connection properties dialog. (This feature is also disabled if you haven't installed .NET 6+.) You can use properties of DateOnly and TimeOnly (such as Year, Month, Hour, Minute, etc.) in LINQ-to-SQL queries and these will be translated into SQL. LINQPad's LINQ-to-SQL also includes an extension method on DateTime called DateOnly() to extract the DateOnly portion - this helps in scenarios such as comparing a DateOnly column with a DateTime column.

Support for DateTime and TimeOnly in EF Core will arrive when this feature has been implemented by the EF Core team.

Util.Dif

LINQPad 7's Util.Dif function now has a more powerful diffing engine that can descend into strings and identify insertions/deletions in scalar-typed lists. This helps in scenarios such as regression testing, where you want to compare the output from old and new algorithms. When strings are compared, a full text-diffing library is employed to show insertions and deletions:

Util.Dif ("The quick brown fox jumps over the lazy dog.",
          "The quick brown fox *jumps* over the lazy dog").Dump();
The quick brown fox jumps*jumps* over the lazy dog.

LINQPad first applies a series of heuristics to determine whether to use word- or line-based chunking, allowing the comparison to be useful in a variety of scenarios without manual input.

JSON support

JsonDocument or JsonNode now render as syntax-highlighted JSON when dumped. Calling Dump(true) results in the JSON being displayed in a separate output panel with an outlining editor (as with XDocument). If you prefer to see the object structure with a JsonNode, you can do so by calling DumpRaw() instead of Dump(). LINQPad also lets you open .json files directly in the editor, with a toolbar option to format the document.

Running LINQPad versions side-by-side

For .NET Framework support, you can continue to run LINQPad 5 side-by-side with LINQPad 7. (You can also run LINQPad 6 side-by-side, although there is little benefit unless you still need to support .NET 3.0 or EF Core 2.x.)

Here are some tips to help you with sharing queries between LINQPad 5 and LINQPad 7:

  • Any .NET Framework assembly references are ignored in LINQPad 7.
  • Other assembly references may cause difficulties unless they are to .NET Standard libraries. NuGet package references are the best option.
  • For conditional compilation, the NETCORE symbol is defined in LINQPad 7 but not LINQPad 5.
  • My Extensions is separate for LINQPad 5 and 7, so each can have different implementations and dependencies. As long as you provide textually similar methods in both, queries will work with both.

LINQPad 7 - Latest Beta

New Features

  • There's a new Video control in the LINQPad.Controls namespace for displaying videos. The control includes Play/Pause methods and properties to control playback speed and position.
  • LINQPad now performs more aggressive filtering on autocompletion lists with 2500+ items, to improve usability and editor performance.

Fixes

  • An issue when dumping multiple IFrame controls has been fixed.
  • The Roslyn visualizer now functions correctly when running under .NET 7.
  • The presence of a #endregion directive immediately preceding the Main method in a query that is #load-ed no longer causes an error.
  • LINQPad's database schema reader can now detect when a stored procedure's name conflicts with a get_ accessor generated by a C# property.
Download LINQPad 7 Beta

Current beta version: 7.6.3

LINQPad 7 betas automatically update when a newer beta is released.

(Scroll up for release versions)