Published .Net Core App Warns to Install .Net Core but it's Already Installed

11,469

Solution 1

Turns out the issue was the fact that the applications were targeting win-x86 and the user only had access to 64-bit runtimes of .Net Core.

For some reason, I thought it would be able to handle a 32-bit version even if it was running 64-bit runtimes.

I guess live and learn.

Solution 2

In my case I had the same issue, and the problem was that I was not deploying the file "MY_PROGRAM_NAME.runtimeconfig.json". After copying this file, which is present in the build output, the application is launched without problems.

Share:
11,469
Christopher Johnson
Author by

Christopher Johnson

Updated on June 18, 2022

Comments

  • Christopher Johnson
    Christopher Johnson almost 2 years

    I made a WPF and Console application for someone to use on their private server which I can't have access to. I used Visual Studio 2019's built-in "Publishing Wizard" to create Framework Dependant single-file apps. When the person opened the WPF app they were greeted with the standard warning:

    A message box displaying the warning To run this application, you must install .Net Core. Would you like to download it now?

    They clicked yes and to my understanding, they installed .Net Core 3.1 which is what the applications target.

    After they restarted the computer they got the exact same warning again. I wasn't sure what was going on so I repackaged the apps as self-contained since the installed version of .Net Core was the same as what my applications were targeting.

    That seemed to work for a little bit. We ran into some unrelated issues that I had to fix in the code on my end and then I re-published the projects and sent them out.

    They tried to use the WPF application and they got the install warning again.

    Now no matter what combination of options I pick in the "Publish Wizard" they keep getting the warning.

    I'm not sure what to do.

    Here's a picture of my publish settings

    A picture describing the Profile Settings for publishing the WPF application.

  • RudolfJan
    RudolfJan almost 4 years
    I agree this is one of the things you need to do, but even if I do, it does not always help me out.
  • RudolfJan
    RudolfJan almost 4 years
    Did you try to install .Net Core 32 bit runtime? I did try this, but it was not helpful at all...
  • Christopher Johnson
    Christopher Johnson almost 4 years
    @RudolfJan I'm going to assume I just targeted a 64-bit build, it's been a long time since this happened.
  • RudolfJan
    RudolfJan almost 4 years
    Thanks for your reply. It still is confusing, but I think I got a working solution now, without really understanding what is going on... There is Publish option that allows to set a publish profile. It creates a long list of dll's to include, no idea why this is necessary and it provides a number of options for deployment. I may want to write down what I understand of it and then check if my understanding is correct.
  • TinyRacoon
    TinyRacoon over 3 years
    Exactly my issue, thanks. Do you know why? X
  • dellos
    dellos about 3 years
    @But is It NetCore was included in your Self Content published file?
  • Christopher Johnson
    Christopher Johnson about 3 years
    Dellos, this happened in 2019, I don't remember anything about this project.
  • TimTIM Wong
    TimTIM Wong over 2 years
    I have two x86 apps. One works, the other doesn't. I wonder what is missing.
  • TimTIM Wong
    TimTIM Wong over 2 years
    Oops, turns out my other project accidentally references ASP.NET Core which is not used.