【问题标题】:Windows App Certification Kit fail Binary analyzer test and supported API testWindows 应用认证工具包未通过二进制分析器测试和支持的 API 测试
【发布时间】:2016-12-22 12:03:30
【问题描述】:

我尝试用发布模式打包一个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. 

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

谢谢。

【问题讨论】:

  • 我正在使用 Microsoft.NETCore.UniversalWindowsPlatform 6.1.9 但我仍然有这个问题

标签: windows-store-apps uwp windows-applications app-certification-kit


【解决方案1】:

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

您需要确保:

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

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

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

【讨论】:

  • 使用此配置创建包失败 bin\x86\Release\ TRACE;NETFX_CORE;WINDOWS_UWPtrue;2008pdbonlyx86false prompttruetruetrue
  • 当我设置 UseDotNetNativeToolchain = true 时它会抛出这个错误内部编译器错误:指定的转换无效。
  • 我使用的是visual studio 2019社区版,在项目属性中找不到Build选项。
【解决方案2】:

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

【讨论】:

  • 我也是。令人惊讶的是,这仍然没有修复。
  • 我正在使用 Microsoft.NETCore.UniversalWindowsPlatform 6.1.9 但我仍然有这个问题
【解决方案3】:

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

是的,.net 原生工具链已检查。我尝试了 x86 和 x64,但它不起作用 - 我的输出目录始终包含 clrjit.dllclrcompression.dll

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

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

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

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

【讨论】:

    【解决方案4】:

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

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

    【讨论】:

      【解决方案5】:

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

      【讨论】:

        【解决方案6】:

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

        以下引用之一是真正的罪魁祸首:

        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-dll-is-not-suppo#answer1

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2015-05-27
          相关资源
          最近更新 更多