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

2

10

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.

Cynar answered 17/12, 2019 at 3:0 Comment(6)
Have you tried it on any other Computers? Any Virtual Machines? Because if it only happens on one, it is propably something majorly wrong with that Computer. Might need a Windows reinstallation.Picket
Sadly no, I can ask the person to try that but it's out of my hands.Cynar
This guy is running a Server, but obviously was incapable of giving you a proper screenshoot. That is a Phone Camera image - and also so zoomed in, we can not be sure if anything else is written on that message box. So I really suspect the issue is on his side.Picket
Simply hitting the PrtScn (Print Screen) button will take a screenshot of the desktop. Hitting Ctrl+C on a dialog box will copy the title, full text and button text. Right now, we can't even guess what the error message is - does the title ask for a different runtime version perhaps?Delineation
They should also run dotnet --version and send the result.Delineation
It's so weird. The title is just the app name, they tried it on their server and laptop with the same warning popping up again, they ran dotnet --version and the server is running 3.1.100 and the laptop was running 3.0.100. For now I'm going to extract the logic into a .Net Framwork solution instead to get it up and going.Cynar
C
5

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.

Cynar answered 17/12, 2019 at 17:15 Comment(7)
Did you try to install .Net Core 32 bit runtime? I did try this, but it was not helpful at all...Roughhouse
@Roughhouse I'm going to assume I just targeted a 64-bit build, it's been a long time since this happened.Cynar
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.Roughhouse
@But is It NetCore was included in your Self Content published file?Roselba
Dellos, this happened in 2019, I don't remember anything about this project.Cynar
I have two x86 apps. One works, the other doesn't. I wonder what is missing.Pelf
Oops, turns out my other project accidentally references ASP.NET Core which is not used.Pelf
W
13

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.

Watch answered 20/3, 2020 at 18:16 Comment(3)
I agree this is one of the things you need to do, but even if I do, it does not always help me out.Roughhouse
Exactly my issue, thanks. Do you know why? XCaseinogen
No, in my case it's already deployed.Jacks
C
5

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.

Cynar answered 17/12, 2019 at 17:15 Comment(7)
Did you try to install .Net Core 32 bit runtime? I did try this, but it was not helpful at all...Roughhouse
@Roughhouse I'm going to assume I just targeted a 64-bit build, it's been a long time since this happened.Cynar
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.Roughhouse
@But is It NetCore was included in your Self Content published file?Roselba
Dellos, this happened in 2019, I don't remember anything about this project.Cynar
I have two x86 apps. One works, the other doesn't. I wonder what is missing.Pelf
Oops, turns out my other project accidentally references ASP.NET Core which is not used.Pelf

© 2022 - 2024 — McMap. All rights reserved.