已发布的.Net Core应用程序警告安装.Net Core,但已安装

问题描述:

我制作了一个WPF和控制台应用程序,供某人在无法访问的私有服务器上使用.我使用Visual Studio 2019的内置发布向导"来创建依赖于框架的单文件应用程序.当该人打开WPF应用程序时,他们收到标准警告:

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:

他们单击了是",并且据我所知,他们安装了.Net Core 3.1,这是应用程序所针对的.

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

重新启动计算机后,他们再次收到完全相同的警告.我不确定发生了什么,所以我将应用程序重新打包为自包含程序,因为.Net Core的安装版本与我的应用程序所针对的版本相同.

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.

他们尝试使用WPF应用程序,并且再次收到安装警告.

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.

我不确定该怎么办.

这是我的发布设置的图片

Here's a picture of my publish settings

原来的问题是应用程序针对win-x86,而用户只能访问.Net Core的64位运行时.

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.

出于某种原因,我认为即使运行64位运行时它也能够处理32位版本.

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

我想生活和学习.