LINQPad 6 and .NET Core 3.1

After installing Visual Studio 2019 version 16.4, which included .NET Core 3.1, I started getting an error when launching LINQPad 6 version 6.5.2 stating it could not load System.Windows.Forms.ContextMenu in the error message. I believe this is because that control has been removed from .NET Core 3.1 per this breaking change document: https://docs.microsoft.com/en-us/dotnet/core/porting/winforms-breaking-changes.

Comments

  • edited December 4

    Thanks for reporting - there's now a beta that runs on netcore 3.1 RTM:
    https://www.linqpad.net/LINQPad6.aspx#beta

    I'll get this rolled out to production very soon if there are no issues.

  • @JoeAlbahari Is that mean LINQPad 6.5.4 now runs on native .NET Core 3.1 when .NET Core 3.1 installed(instead of .NET Core 3.0)?

  • The host process will continue to target .NET Core 3.0, but will run on .NET Core 3.1 if installed. This allows for a single deployment to work with both 3.0 and 3.1.

    The query process runs on the highest 3.x version that's installed.

  • Will that need to be a manual install? Since it seems like it crashes while initializing the UI?

  • edited December 5

    Yes - if it won't start up, you'll need to install the beta manually. Either that, or install the 3.0 SDK.

  • edited December 5

    Hmm, was thinking just me having this issue. Thanks Joe, hopefully general release will come soon.

    EDIT: Turns out beta is not a published version. Already have dotnetcore-sdk v3.1.100 installed, but beta still does not work.

    Regards.

  • The general release is out now.

  • @JoeAlbahari said:
    The general release is out now.

    Okay I have 3.1.100 SDK installed, this still does not work, perhaps needs 3.0 SDK to work. Will test and let you know.

    Regards.

  • @JoeAlbahari said:
    The general release is out now.

    Yup, confirmed, you need .NET Core SDK version 3.0.101 for this to run, it does not run on dotnetcore-sdk v3.1.100 alone.

    Not desirable to have older Core SDK around just to run Linqpad 6 though.

    Regards.

  • Are you talking about the new release? (6.5.5)

    6.5.5 should run on netcore31

  • @JoeAlbahari said:
    Are you talking about the new release? (6.5.5)

    6.5.5 should run on netcore31

    Well it didn't.
    So I use chocolatey for my softwares, it upgraded to dotnetcore-sdk v3.1.100 and LP6 stopped working, choco removes previous versions. I went and did choco install netcore-sdk --version 3.0.101 --force --y to get older one. and then LP6 started working again.

    Regards.

  • Is anyone else unable to start LINQPad 6.5.5 under .NET Core 3.1?

    All of the error reports for this exception are showing version numbers of < 6.5.5.

  • edited December 6

    @JoeAlbahari said:
    Is anyone else unable to start LINQPad 6.5.5 under .NET Core 3.1?

    All of the error reports for this exception are showing version numbers of < 6.5.5.

    Yeah mine is 6.5.5 but error still occurring.

    Sorry but I cannot have older .NET Core 3.0.100 installed as it is affecting my other apps.

    For now, reverting to LP 5 as that works.

    Regards.

  • After updating to 6.5.5 I can run queries, but when I attempt to do a sort by a DateTime field, I get the following error:
    CS0012 The type 'DateTime' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e'. (Press F4 to fix)

  • Updated to VS 16.4 about 30 minutes ago. After, I started experiencing issues in LINQPad 6 similar to what's reported by geirsag (different base types, but the same general message). Brought up LINQPad 5 to verify it works. Closed out LINQPad 6, but it would not start up. Thought maybe there was a background process interferring, but didn't see anything. Then thought it became corrupted and did an uninstall/reinstall with a fresh download (confirmed it's 6.5.5.0). Still won't start up.

  • If it won't start up, can you try running LPRun6 from the command-line. If there's a framework problem, it should display a message to the console. Can you also please check the Windows event log.

  • @geirsag said:
    After updating to 6.5.5 I can run queries, but when I attempt to do a sort by a DateTime field, I get the following error:
    CS0012 The type 'DateTime' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e'. (Press F4 to fix)

    Press F4 and on the advanced tab, right-click the second checkbox ("Copy all NuGet assemblies to single folder'). That should bring up a list of resolved references. Could you post that please?

  • edited December 7

    @JoeAlbahari said:
    If it won't start up, can you try running LPRun6 from the command-line. If there's a framework problem, it should display a message to the console. Can you also please check the Windows event log.

    This is what I found:

    A fatal error was encountered. The library 'hostpolicy.dll' required to execute the application was not found in 'C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App\3.0.0'.
    

    Same message in the event log for LINQPad.

  • I suspect that something tried to uninstall .NET Core 3.0 while it was in use by LINQPad, so you've ended up with a half-installed .NET Core 3.0. I would try completely uninstalling .NET Core 3.0.

  • @JoeAlbahari said:

    @geirsag said:
    After updating to 6.5.5 I can run queries, but when I attempt to do a sort by a DateTime field, I get the following error:
    CS0012 The type 'DateTime' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e'. (Press F4 to fix)

    Press F4 and on the advanced tab, right-click the second checkbox ("Copy all NuGet assemblies to single folder'). That should bring up a list of resolved references. Could you post that please?

    After rebooting, I can no longer reproduce the error, so no worries :)

  • edited December 9

    @JoeAlbahari said:
    I suspect that something tried to uninstall .NET Core 3.0 while it was in use by LINQPad, so you've ended up with a half-installed .NET Core 3.0. I would try completely uninstalling .NET Core 3.0.

    I had a big long post about how my system (for the most part) didn't indicate I had 3.0.0 installed. The only mention of 3.0.0 was as a folder under Microsoft.WindowsDesktop.App, but the folder was empty. dotnet --list-runtimes listed this as an installed runtime.

    Microsoft.WindowsDesktop.App 3.0.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
    

    Because of that rogue entry, I wanted to insure I didn't actually have it installed. Further digging indicated I could just delete this folder to make the runtime go away. A quick rename of the folder and LINQPad6 is up again.

    I suspect you're relying upon the dotnet facilities to tell you which runtime is installed. If so, that's a defect in that area of dotnet. Or maybe it happens automagically.

    Thanks for the assistance.

Sign In or Register to comment.