6

我试图用发布模式打包一个windows应用程序,但是两个测试失败了:

1.二进制分析器失败

Binary analyzer
•Error Found: The binary analyzer test detected the following errors:
  ◦File C:\Program Files\WindowsApps\***_1.0.0.0_x64__2qz35x103g***\clrcompression.dll has failed the AppContainerCheck check.
  ◦File C:\Program Files\WindowsApps\***.MStube_1.0.0.0_x64__2qz35x103g***\clrjit.dll has failed the AppContainerCheck check.  
•Impact if not fixed: If the app doesn’t use the available Windows protections, it can increase the vulnerability of the customer's computer to malware.
•How to fix: Apply the required linker options - SAFESEH, DYNAMICBASE, NXCOMPAT, and APPCONTAINER - when you link the app. See links below for more information:

2.支持的API测试失败

•Error Found: The supported APIs test detected the following errors:
◦API RtlCaptureContext in api-ms-win-core-rtlsupport-l1-1-0.dll is not supported for this application type. clrcompression.dll calls this API.
◦API RtlVirtualUnwind in api-ms-win-core-rtlsupport-l1-1-0.dll is not supported for this application type. clrcompression.dll calls this API.
◦API _XcptFilter in msvcrt.dll is not supported for this application type. clrcompression.dll calls this API.
◦API __C_specific_handler in msvcrt.dll is not supported for this application type. clrcompression.dll calls this API.
◦API _amsg_exit in msvcrt.dll is not supported for this application type. clrcompression.dll calls this API.
◦API _initterm in msvcrt.dll is not supported for this application type. clrcompression.dll calls this API.
◦API free in msvcrt.dll is not supported for this application type. clrcompression.dll calls this API.
◦API malloc in msvcrt.dll is not supported for this application type. clrcompression.dll calls this API.
◦API memcpy in msvcrt.dll is not supported for this application type. clrcompression.dll calls this API.
◦API memset in msvcrt.dll is not supported for this application type. clrcompression.dll calls this API.

•Impact if not fixed:  Using an API that is not part of the Windows SDK for Windows Store apps violates the Windows Store certification requirements. 

•How to fix:  Review the error messages to identify the API that is not part of the Windows SDK for Windows Store apps. Please note, C++ apps that are built in a debug configuration will fail this test even if it only uses APIs from the Windows SDK for Windows Store apps. See the link below for more information: 
 Alternatives to Windows APIs in Windows Store apps. 

我没有办法解决它们...如何修复这两个错误以确保我的应用程序可以正确打包?

谢谢。

4

6 回答 6

3

“clrjit.dll”不应存在于输出目录(例如“bin/x64/Release”)或应用商店提交的 appx 包中。

您需要确保:

  1. 您提交的是发布包,而不是调试,并且
  2. 选中复选框“项目属性 -> 构建 -> 使用 .NET Native 工具链编译”(用于发布配置)。此复选框在 .csproj 文件中另存为 UseDotNetNativeToolchain=true。

请注意,“clrcompression.dll”本身就可以,并且会通过认证。

希望这可以为您节省几个痛苦的时间。降级 NetCore 不是解决方案。

于 2016-11-24T02:49:42.453 回答
1

当我将 NetCore.UWP 版本从 5.2.2 降级到 5.1.0 时,clrcompression.dll 的问题消失了。

于 2016-08-17T15:36:10.893 回答
1

我也有 Microsoft.NETCore.UniversalWindowsPlatform 6.1.9 并且有同样的问题。

是的,.net已检查本机工具链。我尝试了 x86 和 x64,但它不起作用 - 我的输出目录总是包含clrjit.dlland clrcompression.dll

我的任何代码中都没有对 EntityFramework 的引用,所以我不确定这是我遇到的问题。

上面的 corefx 链接有一个新问题的链接 - https://github.com/dotnet/corefx/issues/30594

显然,较新版本的 Microsoft.NETCore.UniversalWindowsPlatform不再需要Microsoft.NETCore.Portable.Compatibility。

删除 Microsoft.NETCore.Portable.Compatibility 解决了我的问题。

于 2019-02-22T08:57:38.157 回答
0

让我们尝试在 Master 模式下构建,而不是 Release 模式。发布模式不适用于应用认证工具包或发布到商店。

于 2020-02-09T08:16:44.050 回答
0

这是 .NET 的错误,请参阅https://github.com/dotnet/corefx/issues/13214https://github.com/aspnet/EntityFramework/issues/6905

作为一种解决方法,也许您可​​以构建一个没有 x64 版本的应用程序包。

于 2016-11-05T11:19:20.037 回答
0

环回标志被指示为一个可能的问题。停用后,测试仍然失败。

以下参考资料之一是真正的罪魁祸首:

Microsoft.VisualStudio.Services.Client
Microsoft.AspNetCore.Mvc.Core
Microsoft.IdentityModel.Clients.ActiveDirectory

作为清理的一部分删除了其中一个的引用。

我相信罪魁祸首是:Microsoft.VisualStudio.Services.Client

NuGet 的描述:与基于桌面、ASP.NET 和其他 Windows 应用程序的 Azure DevOps Server 2019 和 Azure DevOps Services 集成。通过公共 REST API 提供对帐户、配置文件、身份、安全等共享平台服务的访问。

也在这里发布:https ://www.codeproject.com/Answers/5311445/API-istokenrestricted-in-advapi32-dl​​l-is-not-suppo#answer1

于 2021-08-27T12:47:34.420 回答