Published .Net Core App Warns to Install .Net Core but it's Already Installed
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.
Christopher Johnson
Updated on June 18, 2022Comments
-
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:
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
-
RudolfJan almost 4 yearsI agree this is one of the things you need to do, but even if I do, it does not always help me out.
-
RudolfJan almost 4 yearsDid you try to install .Net Core 32 bit runtime? I did try this, but it was not helpful at all...
-
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 almost 4 yearsThanks 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 over 3 yearsExactly my issue, thanks. Do you know why? X
-
dellos about 3 years@But is It NetCore was included in your Self Content published file?
-
Christopher Johnson about 3 yearsDellos, this happened in 2019, I don't remember anything about this project.
-
TimTIM Wong over 2 yearsI have two x86 apps. One works, the other doesn't. I wonder what is missing.
-
TimTIM Wong over 2 yearsOops, turns out my other project accidentally references ASP.NET Core which is not used.