Best Of
Re: (Bug?) Exception from Linqpad, running to completion in Visual Studio/Command Prompt
I don't have 'Microsoft.ACE.OLEDB.12.0' on my machine, so I can't test this properly but looking at the files included in Helper.7z you have two copies of System.Diagnostics.PerformanceCounter.dll
and one of them is a lot smaller and the constructor in CounterCreationData is
public CounterCreationData(string counterName, string counterHelp, PerformanceCounterType counterType) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_PerfCounters); }
whereas the other is
public CounterCreationData(string counterName, string counterHelp, PerformanceCounterType counterType) { CounterType = counterType; CounterName = counterName; CounterHelp = counterHelp; }
So the smaller looks like a non-windows version and being used by LinqPad whereas the latter is the windows version.
Not sure of the exact reason by LinqPad picks the wrong dll but I suspect it is related to the shadowing where it attempts to copy all the necessary dlls to a shadow folder and runs from that folder.
I suspect if you delete this non-windows dll from your Helper\bin\Debug\net9.0 folder, then LinqPad will work.
Not sure how you are supposed to tell which is the correct version as the version numbers are the same.

Re: LINQPad for macOS: First public preview!
Sounds like your project has global using
directives or the project file has <ImplicitUsings>enable</ImplicitUsings>
.
Create a LINQPad script with the following content:
global using System; global using System.Linq; global using System.Collections.Generic; global using System.IO; global using System.Net.Http; global using System.Threading; global using System.Threading.Tasks;
and save it to a file such as "implicits.linq". You can add any other imports that your project needs. Note that this script must have the language set to "C# Statements".
Then in your main script, include this script as follows:
#load "implicits"

Re: Closing Separate Results Window / maximizing pane automatically
It would be nice to have some kind of directive, kind of #LINQPad hide_on_run+
, to hide code window when running. I have an Avalonia application for which I don't need to see the code at all.

Re: LINQPad for macOS: First public preview!
So excited to try! No support on Intel Macs? Getting a "You can't open the application LINQPAd 8 beta.app because this application is not supported on this Mac.".
Hardware 2019 MacBook Pro 8-Core Intel Core i9
OS: 15.1.1
Have an M1 can try with later.

Re: Benchmark stuck on "Waiting for first iteration to complete..."
Has to be a C# program rather than C# Statements.
Example.
#load "BenchmarkDotNet" public UserQuery() : base (LINQPad.Util.CurrentCxString) { } void Main() { RunBenchmark(); } [Benchmark] public void Benchmark() { }
This only works because Linqpad creates the class called UserQuery which is derived from my DbContext and that class has a constructor which takes a string.

Re: Trigger TextBox TextInput event not work
I took a brief look at this last Friday, but didn't have much time to delve further. What I did observe is the event does trigger if you actually type into the TextBox. This makes sense when you consider the name of the event the code hooks into. "TextInput", not "TextChanged". Not sure this is a bug here, though perhaps a feature request.
The initial recommendation stands: If you changing the text in code, call the accompanying event code along with it (and consider writing a single method to do both).

Re: How to using COM Interop.IWshRuntimeLibrary in LINQPad 8
AFAIK there is no NuGet for this.
How I did it for LINQPad 8 x86/x64 .NET 9
Ran Developer Command Prompt for VS
.
Copied file c:\windows\system32\wshom.ocx
somewhere I have write access to.
Ran tlbimp for that file and got IWshRuntimeLibrary.dll
tlbimp wshom.ocx
Output:
Microsoft (R) .NET Framework Type Library to Assembly Converter 4.8.3928.0 Copyright (C) Microsoft Corporation. All rights reserved. TlbImp : warning TI3002 : Importing a type library into a platform agnostic assembly. This can cause errors if the type library is not truly platform agnostic. TlbImp : Type library imported to IWshRuntimeLibrary.dll
IWshRuntimeLibrary.dll
:
// IWshRuntimeLibrary, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null // Global type: <Module> // Architecture: AnyCPU (64-bit preferred) // Runtime: v4.0.30319 // Hash algorithm: SHA1
Created new script:
var sh = new IWshRuntimeLibrary.WshShell(); // Use WshShell instead of WshShellClass! sh.CurrentDirectory.Dump();
Pressed F4
> Additional References
> Add / Browse...
Ran test script.
You might also need to pay attention to bitness. Also you might have to specify STAThread attribute for Main
.

Re: Cannot authenticate to Azure SQL Server with MFA
Hi @JoeAlbahari
Maybe I'm wrong because I'm new in the app or I'm doing bad. this's the process I followed to create a new connection.
Here's the result when I execute the code
In Azure Data Studio and SSMS I have the same error unless, I specify the database as well.

LinqPad 5 also add AI functionality?
LinqPad 7 already has AI functionality, but the .NET Framework is still unavoidable in many people's work environments. Can LinqPad 5 also add AI functionality? Thank you.
