Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 903
Christopher Johnson Avatar asked Dec 17 '19 03:12

Christopher Johnson


2 Answers

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.

like image 111
Ernesto Avatar answered Sep 19 '22 18:09

Ernesto


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.

like image 40
Christopher Johnson Avatar answered Sep 22 '22 18:09

Christopher Johnson