Home

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.

  • 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?

  • edited April 2020

    I'm posting the last two, let me know if you need more.

            6.8.2 (X64) 2020-04-29T17:16:25.1456181-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
    
                -LINQPad.TaskExtensions+<WithComputeTimeout>d__24`1 Void MoveNext() offset: 0xF2
                -System.Runtime.ExceptionServices.ExceptionDispatchInfo Void Throw() offset: 0x11
                -System.Runtime.ExceptionServices.ExceptionDispatchInfo Void Throw(System.Exception) offset: 0x0
                -LINQPad.SystemExtensions Void ThrowWithOriginalStackTrace(System.Exception) offset: 0x7
                -LINQPad.TaskExtensions T GetResult[T](System.Threading.Tasks.Task`1[T]) offset: 0x88
                -LINQPad.ExecutionModel.ProcessClient Void .ctor(LINQPad.ExecutionModel.Isolator, LINQPad.ExecutionModel.ProbingSet, LINQPad.Diagnostics.PerformanceLogger) offset: 0x526
                -LINQPad.Extensibility.DataContext.DriverProxy LINQPad.Extensibility.DataContext.DriverProxy Create(LINQPad.Extensibility.DataContext.DCDriverLoader, System.String, LINQPad.Repository, Boolean, Boolean) offset: 0x23B
                -LINQPad.Extensibility.DataContext.DCDriverLoader LINQPad.Extensibility.DataContext.DriverProxy CreateDriverProxy(System.String, LINQPad.Repository, Boolean, Boolean) offset: 0x0
                -LINQPad.Repository+<GetCustomTypesInAssemblyAsync>d__221 Void MoveNext() offset: 0x48
    
            6.7.5 (X64) 2020-04-29T17:16:52.2834111-05:00 TimeoutException - The operation has timed out.
            Source=LINQPad.Runtime
    
             -LINQPad.TaskExtensions+<WithComputeTimeout>d__24`1 Void MoveNext() offset: 0xF2
             -System.Runtime.ExceptionServices.ExceptionDispatchInfo Void Throw() offset: 0x11
             -System.Runtime.ExceptionServices.ExceptionDispatchInfo Void Throw(System.Exception) offset: 0x0
             -LINQPad.SystemExtensions Void ThrowWithOriginalStackTrace(System.Exception) offset: 0x7
             -LINQPad.TaskExtensions T GetResult[T](System.Threading.Tasks.Task`1[T]) offset: 0x88
             -LINQPad.ExecutionModel.ProcessClient Void .ctor(LINQPad.ExecutionModel.Isolator, LINQPad.ExecutionModel.ProbingSet, LINQPad.Diagnostics.PerformanceLogger) offset: 0x526
             -LINQPad.Extensibility.DataContext.DriverProxy LINQPad.Extensibility.DataContext.DriverProxy Create(LINQPad.Extensibility.DataContext.DCDriverLoader, System.String, LINQPad.Repository, Boolean, Boolean) offset: 0x23B
             -LINQPad.Extensibility.DataContext.DCDriverLoader LINQPad.Extensibility.DataContext.DriverProxy CreateDriverProxy(System.String, LINQPad.Repository, Boolean, Boolean) offset: 0x0
             -LINQPad.Repository System.String[] GetCustomTypesInAssembly(System.String) offset: 0x1B
             -LINQPad.Drivers.EFCore.DbContextCxForm System.String[] GetCustomTypeNames(System.String) offset: 0xC
             -LINQPad.Drivers.EFCore.DbContextCxForm Void ChooseTypeName() offset: 0x1F
    
  • 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

    -LINQPad.TaskExtensions+<WithComputeTimeout>d__24`1 Void MoveNext() offset: 0xF2
    -System.Runtime.ExceptionServices.ExceptionDispatchInfo Void Throw() offset: 0x11
    -System.Runtime.ExceptionServices.ExceptionDispatchInfo Void Throw(System.Exception) offset: 0x0
    -LINQPad.SystemExtensions Void ThrowWithOriginalStackTrace(System.Exception) offset: 0x7
    -LINQPad.TaskExtensions T GetResult[T](System.Threading.Tasks.Task`1[T]) offset: 0x88
    -LINQPad.ExecutionModel.ProcessClient Void .ctor(LINQPad.ExecutionModel.Isolator, LINQPad.ExecutionModel.ProbingSet, LINQPad.Diagnostics.PerformanceLogger) offset: 0x526
    -LINQPad.Extensibility.DataContext.DriverProxy LINQPad.Extensibility.DataContext.DriverProxy Create(LINQPad.Extensibility.DataContext.DCDriverLoader, System.String, LINQPad.Repository, Boolean, Boolean) offset: 0x23B
    -LINQPad.Extensibility.DataContext.DCDriverLoader LINQPad.Extensibility.DataContext.DriverProxy CreateDriverProxy(System.String, LINQPad.Repository, Boolean, Boolean) offset: 0x0
    -LINQPad.Repository+<GetCustomTypesInAssemblyAsync>d__221 Void MoveNext() offset: 0x48
    

    `

  • edited May 2020

    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. :(

  • edited May 2020

    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

    LOG: This bind starts in default load context.
    LOG: Download of application configuration file was attempted from
    file:///C:/Users/MyUser/AppData/Local/LINQPad/6.8.3/ProcessServer/3.1.4-> x64/LINQPad.DriverProxy.LINQPad.Drivers.EFCore.exe.config.
    LOG: Configuration file C:\Users\MyUser\AppData\Local\LINQPad\6.8.3\ProcessServer\3.1.4-x64\LINQPad.DriverProxy.LINQPad.Drivers.EFCore.exe.config does not exist.
    LOG: No application configuration file found.
    LOG: Using host configuration file:
    LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config.
    LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
    LOG: Attempting download of new URL file:///C:/Users/MyUser/AppData/Local/LINQPad/6.8.3/ProcessServer/3.1.4-x64/OptaneShellExt.DLL.
    LOG: Attempting download of new URL file:///C:/Users/MyUser/AppData/Local/LINQPad/6.8.3/ProcessServer/3.1.4-x64/OptaneShellExt/OptaneShellExt.DLL.
    LOG: Attempting download of new URL file:///C:/Users/MyUser/AppData/Local/LINQPad/6.8.3/ProcessServer/3.1.4-x64/OptaneShellExt.EXE.
    LOG: Attempting download of new URL file:///C:/Users/MyUser/AppData/Local/LINQPad/6.8.3/ProcessServer/3.1.4-x64/OptaneShellExt/OptaneShellExt.EXE.
    LOG: All probing URLs attempted and failed.

  • 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.

Sign In or Register to comment.