Assembly.GetEntryAssembly only works when run in LinqPad 7 GUI

It is null in other 3 cases: LinqPad 5 GUI or Lprun, Lprun in in LinqPad 7.

There are some other nuget packages I want to use which unfortunatley is using this method and I cannot change them, so right now this only works in LinqPad 7 GUI.

I wonder if this can be fixed in Lprun of version 7.



  • Options

    It's not easy to change this. In LINQPad 5, is null due to the use of an AppDomain to configure the execution environment. In LPRun in LINQPad 7, it is null because LPRun is a custom CLR host. This allows it to dynamically choose the .NET version (based on your LINQPad preferences, the query, and the optional -fx switch). Without this, it would have to use a fixed .NET version which would have to be hardcoded into a .runtimeconfig.json file, or else run the query in a new process which would be quite inefficient and mess up stdin/stdout/stderr.

Sign In or Register to comment.