LINQPad 9 - Early Preview now available
Comments
-
What's the issue with running ILSpy 8.2 with .NET 10?
I cannot make LINQPad work with ILSpy 9. While the command-line parameter issue is easy to fix, there's another problem with their new IPC mechanism. It essentially prevents LINQPad from reliably re-using a particular instance that it created. Will need to log a feature request with ILSpy when I get a chance to get this fixed.
-
@JoeAlbahari said:
What's the issue with running ILSpy 8.2 with .NET 10?Try pressing F12 on List on a line like :
List<string> x = new();
Or you can just run directly
"%localappdata%\LINQPad\ILSpy8.2\ILSpy.exe" "C:\Program Files\dotnet\shared\Microsoft.NETCore.App\10.0.0-preview.5.25277.114\System.Collections.dll" /navigateTo:T:System.Collections.Generic.List`1 /separateThe source of the line where It crashes is
as version is just 10.0 rather then 10.0.0
Not sure whether it is this line that is wrong or whether version should not be detected as 10.0 but 10.0.0.
-
Trying to add some extensions using the new syntax and getting an NRE in LINQPad with no details. Works fine if it's converted to the older syntax.
void Main() { typeof(Dictionary<string, ValueTuple<int, string, object>>).GetFriendlyName().Dump(); } public static class TypeExtensions { extension(Type type) { public string GetFriendlyName() { return Impl(type); static string Impl(Type type, bool skipGeneric = false) => Type.GetTypeCode(type) switch { TypeCode.Boolean => "bool", TypeCode.Char => "char", TypeCode.SByte => "sbyte", TypeCode.Byte => "byte", TypeCode.Int16 => "short", TypeCode.UInt16 => "ushort", TypeCode.Int32 => "int", TypeCode.UInt32 => "uint", TypeCode.Int64 => "long", TypeCode.UInt64 => "ulong", TypeCode.Single => "float", TypeCode.Double => "double", TypeCode.Decimal => "decimal", TypeCode.String => "string", TypeCode.Object when type == typeof(object) => "object", _ => type switch { { IsGenericType: true } when type.GetGenericTypeDefinition() == typeof(Nullable<>) => $"{Impl(Nullable.GetUnderlyingType(type)!, skipGeneric)}?", { IsGenericType: true } when typeof(ValueTuple).GetInterface("IValueTupleInternal")!.IsAssignableFrom(type) => ValueTupleName(type), { IsGenericType: true } when !skipGeneric => GenericTypeName(type), { IsNested: true } => $"{Impl(type.DeclaringType!, skipGeneric)}+{type.Name}", { IsArray: true } => $"{Impl(type.GetElementType()!, skipGeneric)}[]", { IsByRef: true } => $"out {Impl(type.GetElementType()!, skipGeneric)}", { IsPointer: true } => $"{Impl(type.GetElementType()!, skipGeneric)}*", _ => $"{type!.Namespace}.{type.Name}", }, }; static string ValueTupleName(Type tupleType) { // value tuples in practice will be generic and have at least 2 type parameters // though, non-generic and 1-tuple is possible, we'll ignore return $"({string.Join(", ", tupleType.GenericTypeArguments.Select(t => Impl(t)))})"; } static string GenericTypeName(Type genericType) { var typeParameters = new Queue<string?>(genericType.GenericTypeArguments.Select(t => Impl(t))); var nestedName = Impl(genericType, skipGeneric: true)!; return Regex.Replace(nestedName, @"`(\d+)", m => { var replacements = Enumerable.Range(0, int.Parse(m.Groups[1].Value)) .Select(_ => typeParameters.Dequeue()); return $"<{string.Join(", ", replacements)}>"; }); } } } }
-
This should now be fixed with the latest Roslyn update in 9.1.5
-
There seems to be an issue with the down-arrow after commenting out some code.
To reproduce, start with this example script"1".Dump(); "2".Dump(); "3".Dump(); "4".Dump(); "5".Dump();
Highlight the first line and press Ctrl-K, Ctrl-C to comment out the line.
Then when you press the down-arrow key to try to go down to the third or fourth line it doesn't do anything.
If you press the up-arrow everything starts working again.Also, when it is stuck, if you press return it brings up the LinqPad settings dialog box,
-
I noticed the caret disappears after. Maybe it's stuck in a chord mode? Uncommenting (Ctrl+K, Ctrl+U) doesn't have the same behavior. Toggling comments (Ctrl+/) doesn't appear to have this problem.
-
Thanks - this will be fixed in the next beta.
-
Thanks
-
This issue has cropped up several times, but I never manage to reproduce it simply until now.It is not entirely consistent as sometimes it goes wrong first time and other times you have to repeat the process two or three times.
Repo:
1. Open two scripts (Script 1 and Script 2) and make Script 2 display something (e.g. 2) 2. Switch to Script 1 3. Press F8 twice. 4. Switch to Script 2 5. Run this script. At some stage (maybe the first time) the results panel is shown without the contents. 6. Otherwise go back to Step 2.
The actual contents of the scripts don't matter and the issue happens even if the scripts are blank.
When this goes wrong it looks like this -
Pressing F8 will show the results in Full Screen mode and F8 shrinks them back and displays them properly, but once this happens it keeps happening (inconsistently) when switching to and running other scripts until LP is exited.
P.S. There may be an issue with the Ordered List feature of the forum editor. The numbers are added to the editor, but not shown when previewed, so I have marked the steps as code so that the numbers show up.
-
Thanks for the repro. This should be fixed in the next build.
-
In Settings|Editor->General the Appearance box has the Custom font capability but is missing the notice that was in LINQPad 8 on how to change the font size. It seems there is room to put that back on the right side of the box.
Also, the extension members sample has an error even though I have preview features enabled and changed .NET version to 10.0 - it can't find the
Count
extension. -
I don't think the new tab buttons work as well as the old tabs - they seem more like independent buttons instead of being associated with the content of the editor or results pane.
In addition the way the unselected tabs change shape because they overlap seems a bit strange.
-
It seems like the previous update added a weird child window bug when in dark mode. The background of the title bar is all white and text still white on black. And this is happening on many child windows (e.g., global settings, script settings, nuget package manager) but not all (e.g., database connection dialogs). I guess some styling is missing for dark mode, it looks normal in light mode.
-
Are you on Windows 10 by any chance? And if so, what version does
Environment.OSVersion
report? -
@JoeAlbahari said:
Are you on Windows 10 by any chance? And if so, what version doesEnvironment.OSVersion
report?I'm using the following version and got same issue:
Platform ServicePack Version VersionString
-------- ----------- ------- -------------
Win32NT 10.0.19045.0 Microsoft Windows NT 10.0.19045.0 -
Using Windows 10 Enterprise, though I'm not at work right now.
In Windows settings, I actually have "Title bars and window borders" using the accent color at home so it doesn't manifest the same. It looks fine.
But if disabled, it will show the same problem. Same exact version as JoeYellow_ming.
-
Thanks - I've now reproduced this in a Win10 VM. There will be a fix in the next build.
-
About pressing the "Ctrl" key on the keyboard and clicking the hyperlink in the Code Editor
-
Looks like a RegEx issue. Will get this fixed.
-
Hi,
I’m wondering if LINQPad 9 for macOS will include support for Charts.
Thanks!
-
It will be supported at some stage - most likely using Oxyplot as the backend instead of the WinForms charting library. I don't have a timeline right now, but am hoping for September/October this year.
-
Thanks @JoeAlbahari for LinqPad 9. The current state is already really good, both on macOS and Windows. On Windows, I can select the "System" option under "General -> Appearance". Can you please offer this option for macOS as well?
-
I'm having an issue even trying to connect to Azure SQL Server through AD.
In the connection string setup it looks like this for me:
I have obviously edited out the server name and email domain. Because of our funky AD setup, our @domain.com addresses aren't actually in our Azure tenant so trying to use that as your domain doesn't work. So I am forced to paste in the actual tenant ID here so I've edited it out as well. (Note here also the WPF stuff in the dialog because I have VS attached to it.)
If I let it run thru I end up with this dialog:
With VS attached I can see what it's doing and when it tries to run
LINQPad.Drivers.LinqToSql.ActiveDirectory.exe
with the argumentsa9d8dad0-9555-4b41-8eaf-8a94474ced0a <hwnd>
.When I try running this myself in a console window I get this:
Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.IdentityModel.Clients.ActiveDirectory, Version=4.5.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified. at LINQPad.Drivers.LinqToSql.ActiveDirectory.Program.Main(String[] args)
Interesting that it's trying to use the ADAL library.
So I go hunt down this nuget package and manually put the dll in the folder%localappdata%\LINQPad\9.2.3\L2S
.In any case after a lot of farting around trying 5.3, not working, going back to 4.5.1 and using .net standard and not working, then using the .net framework 4.5 version from 4.5.1 now it finally connects and resolves and my error goes away.
However, why did I need to go find that DLL myself, and why wasn't it installed in that folder as a dependency? Seems weird it's missing.
-
Wow, thanks @JoeAlbahari for the "automatic completion" AI option in the latest build. That's a great addition for my workflow.
-
I think a recent update changed the way lines are commented out. The comments are added to the beginning of the line, rather than the beginning of the text on the line like it used to. This messes with automatic indentation and really hurts the editing experience.
Could this be reverted back to the original behavior placing the comments at the beginning of the text?
-
Certainly can - will do so in the next build.
-
@CraigVenz - some strange condition was causing it to use legacy interop. I've removed the legacy support entirely in 9.2.5 so the problem should now go away.
-
In the "Open Recent File (Ctrl+Shift+O)" dialog box, with the left mouse button click "Show All Scripts (Ctrl+; or Ctrl+,)" label on the lower left corner of the dialog box, the LINQPad9 processes directly terminated.
After pressing the key combination "Ctrl+;" or "Ctrl+," on the keyboard, the "Navigate to Script (Ctrl+; or Ctrl+,)" dialog box can be opened normally.
-
Thanks - will fix this in the next build.
-
I was trying out using the AI chat today using Azure OpenAI. I have deployed a model to my azure openai instance (gpt-4.1-mini). I set up Linqpad with it like this:
Using autocomplete in the editor works fine.
I opened the AI chat window, typed in some stuff, pressed submit, then it started responding and froze, and linqpad was using 20% cpu and was mostly unresponsive. I thought it might have been related to having not deployed any more models other than 4.1-mini where the defaults all say 4.1 so I killed it and tried again, same issue.
I ran the internal profiling thing and attached the results.
I ran another query that was just plain english and it worked fine, so it must have been the specific query I gave it.
It was:
Question: Please format this html code as markdown.
I included the file in the post. I had gone to github to find the issue about windows-latest images being updated to windows-server 2025 after one of our devs asked us about it, and I copied the whole table out of the page and wanted to format it as markdown. I had used powertoys smart paste to take the copy paste from the page to 'paste as markdown' and it ended up with what looks like some kind of markdown/html hybrid. I didnt look at it real closely. I just tried pasting it into the linqpad box as chat just to see if it would work. It didn't.