LINQPad 6 (v6.6.7) sporadically has issues finding context when in assembly.
Since upgrading to LINQPad 6 and using EF Core 3.1 I have sporadic issues choosing the DbContext when trying to add a connection. The error "Cannot load assembly: TimeoutException" pops up even though the dll is there and contains a DbContext.
This doesn't always happen but when it does it repeatedly happens even after rebuilds etc...
This never happened with LinqPad5.
Comments
As an experiment I ran Linqpad6 as administrator. When doing that everything the above issue did not occur.
Unfortunately running that app as Admin each time is against corp policy and is not an acceptable solution.
I'm guessing the timeout is too low. I'll refactor this in the next build so that that the call is asynchronous and cancellable rather than relying on a timeout.
This fix is now available in 6.8.1:
https://www.linqpad.net/LINQPad6.aspx#beta
I upgraded to 6.8.1. The issue continued.
I upgraded to 6.8.2 The issue is still present.
If you go to %localappdata%\linqpad\Logs.LINQPad6, you'll see a file called LINQPad.Drivers.EFCore.txt which will contain full details of the error. Could you post the relevant entry please?
I'm posting the last two, let me know if you need more.
As I mentioned earlier when running as administrator it runs as expected without any issues.
Unfortunately running that app as Admin each time is against corporate policy and is not an acceptable solution.
Now when I run Linqpad6 as administrator I get the following error when I try to expand a context.
`6.8.2 (X64) 2020-05-01T10:54:10.9974761-05:00 AggregateException - One or more errors occurred. (The operation has timed out.)
Source=System.Private.CoreLib
-System.Threading.Tasks.Task Void ThrowIfExceptional(Boolean) offset: 0x11
-System.Threading.Tasks.Task Boolean Wait(Int32, System.Threading.CancellationToken) offset: 0x3F
-System.Threading.Tasks.Task Boolean Wait(Int32) offset: 0x0
-LINQPad.Drivers.EFCore.DbContextCxForm Void ChooseTypeName() offset: 0x3B
INNER: TimeoutException - The operation has timed out.
Source=LINQPad.Runtime
`
Using .Net Core 3.1.3
Tried reinstalling the non-beta version of LinqPad6 6.7.5 (x64)
Tried running the x86 version.
Tried other previously working versions of my context dll.
I keep getting the same error.
Basically when trying to use a Typed Data Context from my own assembly Linqpad has become useless.
Created a simple example project using Core 3.0. This too timed out.
Same issue with a Core 2.2 project.
The LinqPad 6 app has become unusable. It was a major part of our work flow now it is just a major frustration.
Tried uninstalling and reinstalling and the problem still persists.
The log indicates that LINQPad is unable to start and communicate with a helper process required to isolate the data context. Are you getting this error in situations other than using EF Core 3? For instance, when executing queries?
When using my various context DLLs in my various software projects I am not getting any errors related to that.
I do wonder though if it is security related. Our corp policy only allows us to install software with a special login (with admin rights). After the install I am then running with my normal login. This used to work fine that way. The issue seems to be happening more frequently since I upgrade my SDKs and runtimes to 3.1.3.
I reinstalled LP yesterday (again under my admin login) and now when I run it under my admin login it seems to be working reliably. Unfortunately I can't run that way long term.
LINQPad extracts the helper process and files to the %localappdata%\LINQPad folder, under a subdirectory with the current LINQPad version number. It might be possible that the permissions are somehow screwed up such that non-admin users cannot write/read/execute this folder, or files in this folder.
Looked them over but didn't see any permissions issues. checked them both as my normal user and the admin/install user. I'll keep an eye on them.
When watching for binding errors I get the following errors when I try to load and connect a context assembly
This looks very strange. LINQPad.DriverProxy.LINQPad.Drivers.EFCore.exe is a .NET Core executable, but it's being treated as though it was a .NET Framework PE.
Also, I don't know why it's looking for OptaneShellExt/OptaneShellExt.EXE. This is not part of LINQPad or .NET Core AFAIK.