Windows App Certification Kit не прошел тест двоичного анализатора и поддерживаемый тест API
Я попытался упаковать приложение для 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.
У меня нет способов их решить... Как исправить две ошибки, чтобы убедиться, что мое приложение может быть правильно упаковано?
Благодарю.
6 ответов
"Clrjit.dll" не должно существовать в выходном каталоге (например, "bin/x64/Release") или в пакете appx для отправки в Store.
Вы должны убедиться, что:
- вы отправляете пакет Release, а не Debug, и
- флажок "Свойства проекта -> Сборка -> Компилировать с помощью.NET Native tool chain" (для конфигурации выпуска). Этот флажок сохраняется как UseDotNetNativeToolchain=true в вашем файле.csproj.
Обратите внимание, что "clrcompression.dll" само по себе хорошо и пройдет сертификацию.
Надеюсь, это сэкономит вам несколько мучительных часов. Понижение NetCore не является решением.
Когда я понизил версию NetCore.UWP с 5.2.2 до 5.1.0, проблемы с clrcompression.dll исчезли.
У меня также есть Microsoft.NETCore.UniversalWindowsPlatform 6.1.9 и та же проблема.
Да, .net
Родной набор инструментов проверен. Я пытаюсь x86 и x64, и это не работает - мой выходной каталог всегда содержит clrjit.dll
а также clrcompression.dll
,
В моем коде нет ссылки на EntityFramework, поэтому я не уверен, что это проблема, с которой я сталкиваюсь.
Ссылка на corefx выше содержит ссылку на новую проблему - https://github.com/dotnet/corefx/issues/30594
Очевидно, что Microsoft.NETCore.Portable.Comptable больше не требуется с более новыми версиями Microsoft.NETCore.UniversalWindowsPlatform.
Удаление Microsoft.NETCore.Portable.Compatibility устранило мою проблему.
Пусть попробуют построить в режиме Master, а не в Release Mode. Режим выпуска не предназначен для комплекта сертификации приложений или публикации для хранения.
Это ошибка.NET, см. https://github.com/dotnet/corefx/issues/13214 и https://github.com/aspnet/EntityFramework/issues/6905.
В качестве обходного пути, возможно, вы можете собрать пакет приложения без версии x64.
Флаги обратной петли были указаны как возможная проблема. После деактивации тесты все равно не прошли.
Истинным виновником была одна из следующих ссылок:
Microsoft.VisualStudio.Services.Client
Microsoft.AspNetCore.Mvc.Core
Microsoft.IdentityModel.Clients.ActiveDirectory
Были ссылки на один из них, который был удален в рамках очистки.
Я считаю, что виноват:Microsoft.VisualStudio.Services.Client
Описание из NuGet: интеграция с Azure DevOps Server 2019 и Azure DevOps Services из настольных приложений, приложений ASP.NET и других приложений Windows. Предоставляет доступ к службам общей платформы, таким как учетная запись, профиль, идентификация, безопасность и т. Д., Через общедоступные REST API.
Также размещено здесь: https://www.codeproject.com/Answers/5311445/API-istokenrestricted-in-advapi32-dll-is-not-suppo#answer1