UWP sideload 安装失败,原因是 Microsoft.NET.CoreFramework.2.2。

huangapple go评论64阅读模式
英文:

UWP sideload install failed due to Microsoft.NET.CoreFramework.2.2

问题

我目前在分发和开发的UWP应用程序上遇到一些问题。我尝试在与其开发相同的计算机上安装该应用程序,但是在另一个没有管理员权限的用户帐户上。

主要问题是由包"Microsoft.NET.CoreFramework.2.2"引起的。

(1)首先,我尝试简单地安装它,(2)然后我尝试在package.appxmanifest中添加以下行:

<Dependencies>
    <PackageDependency Name="Microsoft.NET.CoreRuntime.2.2" MinVersion="2.2.27902.3" Publisher="CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US" />
</Dependencies>

我不知道"MinVersion"或"Publisher"是否正确,因为我没有找到任何关于它的信息。我基于https://learn.microsoft.com/en-us/troubleshoot/developer/visualstudio/cpp/libraries/c-runtime-packages-desktop-bridge 中的声明,因为该包已经被集成,因为它引发了相同的问题。

我目前对这个发布的版本有以下问题:

图像1:
UWP sideload 安装失败,原因是 Microsoft.NET.CoreFramework.2.2。

图像2:
UWP sideload 安装失败,原因是 Microsoft.NET.CoreFramework.2.2。

之前,我尝试遵循类似主题https://learn.microsoft.com/en-us/answers/questions/79515/uwp-app-(x64)-microsoft-net-coreruntime-2-2-appx-f 中提供的答案。

提供的答案没有帮助我解决问题。

有关配置的更多信息:

(1)计算机环境:Windows 10 版本22h2构建19045.2546

(2)UWP设置:

(a)目标版本:Windows 10版本2004构建19041

(b)最低目标:Windows 10版本1903构建18362

我将乐意提供任何其他有用的信息,以帮助您帮助我。

英文:

I currently have some issues distributing and UWP app I developped. I tried to install the application on the same computer on which it has been developped but in another user account which does not have administrator priviledges.

The main issue is caused by the package "Microsoft.NET.CoreFramework.2.2".

(1) First I tried to install it simply, (2) then I tried to add in package.appxmanifest the following line:

&lt;Dependencies&gt;
	&lt;PackageDependency Name=&quot;Microsoft.NET.CoreRuntime.2.2&quot; MinVersion=&quot;2.2.27902.3&quot; Publisher=&quot;CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US&quot; /&gt;
&lt;/Dependencies&gt;

I do not know if it 'Minversion' or 'Publisher' are correct since I did not found any information about it. I based the declarations on https://learn.microsoft.com/en-us/troubleshoot/developer/visualstudio/cpp/libraries/c-runtime-packages-desktop-bridge which has already been integrated since the package was causing the same issue.

I currently have the following issue for this release published:

Image 1:
UWP sideload 安装失败,原因是 Microsoft.NET.CoreFramework.2.2。

Image 2:
UWP sideload 安装失败,原因是 Microsoft.NET.CoreFramework.2.2。

Previously, I tried to follow the answer provided in a similar topic https://learn.microsoft.com/en-us/answers/questions/79515/uwp-app-(x64)-microsoft-net-coreruntime-2-2-appx-f

The answer provide did not helped me to solve the issue at all.

More information about the configuration:

(1) Computer environment: Windows 10 Version 22h2 build 19045.2546

(2) UWP settings :

(a) Target version: Windows 10 version 2004 build 19041

(b) Minimal target: Windows 10 version 1903 build 18362

I will gladly provide any other useful information which could lead you to help me.

答案1

得分: 0

我发现解决方案中的错误。

问题出在用于安装包的WPF应用程序上。由于需要证书来在本地计算机上安装包,我强制WPF应用程序以管理员权限运行。我使用cmd.exe来悄悄启动PowerShell命令。

后来,我只是使用了Visual Studio生成的PowerShell命令来安装包,但我没有删除这个cmd.exe命令。

我认为问题就出在这里。我想,使用管理员权限运行PowerShell命令来安装包,使UWP应用程序在管理员会话中可用,而不是在已打开的会话中。

在移除了这个约束(安全性)之后,应用程序成功安装了该包。

英文:

I found the error in the solution.

The issue came from the wpf application used to install the package. Since the certificated was needed to be install the package in the local machine, I was forcing the wpf application to be launched with administrator priviledges. I was using a cmd.exe to silently launch powershell command.

Later, I just used the powershell command generated by visual studio to install the package, but I did not remove this cmd.exe command.

I think the issue came from there. I suppose running the powershell command to install the package using the admin priviledges made the UWP app available inside the administator session and not the opened session.

After removing this constraint (security), the package has successfully installed by the application.

huangapple
  • 本文由 发表于 2023年3月7日 20:27:24
  • 转载请务必保留本文链接:https://go.coder-hub.com/75661971.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定