Best Of
Re: Selecting a Framework
LINQPad 8 supports only .NET 3.1 and later, i.e., .NET Core 3.1, 5, 6, 7, 8, and 9.
For .NET Framework 4.x support, you need to download LINQPad 5.

Re: Works in Visual Studio 2022 but not in LINQPad
AFAIK 0x80131534 isn't a very helpful error as it very generic (sort of like a TypeInitializationException which tells you a C# type did not initialise, but you need to look at the inner exceptions to try to find out why).
So does the stack trace or inner exceptions show anything more?
Unfortunately I don't have any magic solution to diagnose the issue, but some suggestions (based on my own experience where a project failed in LinqPad. It took a while to discover LinqPad was using the wrong dll (which unfortunately for me had the same version number as the correct one !)).
Try to make sure the environments are as similar as possible, e.g. using the same framework version and bitness.
Rather than using nuget packages, add all the dlls from the bin folder from your working project to your LinqPad script.
Check your VS project bin folder for extra files which might be needed like appsettings.json,
Add Util.Cmd (@"explorer .");
to your script and then compare the dlls there with those in your bin folder. Also look out for sub-folders.
Use ProcessExplorer or ProcessMonitor to see what files are being load by both your LinqPad script and your console app.
Failing that add Debugger.Break();
to your linqpad script and attach VS and disable debug 'just my code' and enable break on first exception and see if that helps pinpoint the error.

Re: LINQPad for macOS: First public preview!
The sample download feature hasn't been implemented yet - it's coming soon.

Re: Customizing Dump in a DataContext package
static object ToDump(object input)
should be in Program
context and not in class, (example).
It should be member method in your case, (example).

Re: Get run values at start from the user
You can also use Util.ReadLine
with an enum:
var env = Util.ReadLine<Env> ("what environment?", Env.Dev); enum Env { Dev, Sys, Stg, Prd };

Re: (Bug?) Exception from Linqpad, running to completion in Visual Studio/Command Prompt
'Microsoft.ACE.OLEDB.12.0' is Microsoft Access Database Engine 2016 Redistributable (https://www.microsoft.com/en-us/download/details.aspx?id=54920). I have to use it for connecting to some legacy databases.
But to the point: That's it! I renamed it and it worked!
But it's a problem nonetheless.
It makes Linq To DB fail as well too (if you use it in the same linqpad script), and it should work out of the box.
But it is as you said. I will use the workaround until linqpad refines the "dll shadowing logic" and it becomes obsolete!
Thank you very much!!! And thanks to @JoeAlbahari for such a wonderful tool

Re: Get mutiple files from Input failed
var tbFileSingle = new LINQPad.Controls.TextBox().SetFile().Dump("Single File"); var btnSingle = new LINQPad.Controls.Button("print selected single file").Dump("Single File"); btnSingle.Click += (s, e) => { tbFileSingle.Text.Dump("Single File"); }; var tbFileMultiple = new LINQPad.Controls.TextBox().SetFileMutiple().Dump("Multiple File"); var btnMultiple = new LINQPad.Controls.Button("print selected mutiple file").Dump("Multiple File"); btnMultiple.Click += (s, e) => { // >>> BEGIN: New code. var path = Path.GetDirectoryName(tbFileMultiple.Text); var len = Convert.ToInt32(tbFileMultiple.HtmlElement.GetAttribute("files.length")); for(var i = 0; i < len; i++) { Path.Join(path, tbFileMultiple.HtmlElement.GetAttribute($"files[{i}].name")).Dump(); } // >>> END: New code. }; public static class Ext_TextBox { public static LINQPad.Controls.TextBox SetFile(this LINQPad.Controls.TextBox control) { control.HtmlElement.SetAttribute("type", "file"); return control; } public static LINQPad.Controls.TextBox SetFileMutiple(this LINQPad.Controls.TextBox control) { control.SetFile(); control.HtmlElement.SetAttribute("multiple", ""); return control; } }
You can inspect specific field content in HTML DevTools (F12
in result pane) by executing in console document.getElementById("<ID>").files

Re: linqPad IWebdriver want to connect to Mysql ?
IWebdriver
has no relation to LINQPad. It's part of Selenium.
Since broken collection Mysql
is selected script fails on startup.

Re: linqPad IWebdriver want to connect to Mysql ?
Change connection (at the top right) to none

Re: is it possible to create a self hosted api endpoint within linqpad?
There's a demo in the inbuilt samples. Press Ctrl+F1 and search for ASP.NET web.
