Home

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 2019

    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 2019

    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 2019

    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 2019

    @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 2019

    @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 2019

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

  • edited December 2019

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

    That was a good idea, since I have 3.1.0 and not 3.0.0, LP6 refuses to run, now take a look at the output please, guess it really is 3.0.0 specific and an update in framework is not recognised.
    Perhaps a new version targeting "3.0.0 and above" might solve the problem.

    The main location has same probelm:

    Regards.

  • Can you please type:

    dotnet --list-runtimes
    

    and let me know the output. I want to make sure that you have a NetCore.App/WindowsDesktop matching pair.

  • edited December 2019

    @JoeAlbahari said:
    Can you please type:

    dotnet --list-runtimes
    

    and let me know the output. I want to make sure that you have a NetCore.App/WindowsDesktop matching pair.

    Yes sure

    .

    Same in code

    fawad.raza@LT-5CG9083MJG C:\Users\fawad.raza
    # dotnet --list-runtimes
    Microsoft.AspNetCore.All 2.1.13 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
    Microsoft.AspNetCore.All 2.1.14 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
    Microsoft.AspNetCore.All 2.2.5 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
    Microsoft.AspNetCore.All 2.2.7 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
    Microsoft.AspNetCore.App 2.1.13 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
    Microsoft.AspNetCore.App 2.1.14 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
    Microsoft.AspNetCore.App 2.2.5 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
    Microsoft.AspNetCore.App 2.2.7 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
    Microsoft.AspNetCore.App 3.0.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
    Microsoft.AspNetCore.App 3.1.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
    Microsoft.NETCore.App 1.0.16 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
    Microsoft.NETCore.App 1.1.13 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
    Microsoft.NETCore.App 2.1.13 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
    Microsoft.NETCore.App 2.1.14 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
    Microsoft.NETCore.App 2.2.4 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
    Microsoft.NETCore.App 2.2.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
    Microsoft.NETCore.App 2.2.6 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
    Microsoft.NETCore.App 2.2.7 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
    Microsoft.NETCore.App 3.1.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
    Microsoft.WindowsDesktop.App 3.0.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
    Microsoft.WindowsDesktop.App 3.1.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
    
    fawad.raza@LT-5CG9083MJG C:\Users\fawad.raza
    

    Regards

  • Your netcore 3.0 is incorrectly installed: that there's an entry for Microsoft.AspNetCore.App and Microsoft.WindowsDesktop.App, but not for Microsoft.NETCore.App.

    Either completely remove netcore 3.0, or re-install its SDK.

    Note that I plan to address this in the long term by enhancing LINQPad's .NET Core installer such that it detects and warns about this condition.

  • edited January 2020

    @JoeAlbahari said:
    Your netcore 3.0 is incorrectly installed: that there's an entry for Microsoft.AspNetCore.App and Microsoft.WindowsDesktop.App, but not for Microsoft.NETCore.App.

    Either completely remove netcore 3.0, or re-install its SDK.

    Note that I plan to address this in the long term by enhancing LINQPad's .NET Core installer such that it detects and warns about this condition.

    Hello and hope you had good holidays.

    Indeed, installing .NET Core 3.0 SDK did solve the problem, I'd rather have updated LINQPad to target Core 3.1 etc and have backward compatibility that way, but yes it is working now. Hoorrray 🙂

    Regards.

  • edited January 2020

    As help for everyone who has the same issue:

  • I also faced same problem and the above discussion helped me to solve it. Thank you linkpad for prividing this platform.

Sign In or Register to comment.