Windows应用认证工具包报错:选择条件未匹配任何测试
Hey, sorry to hear you're hitting this frustrating WACK error when prepping your WinForms app for the Microsoft Store. Let's walk through the most common fixes for this exact issue, since you're using the Visual Studio 2017 Windows Application Packaging Project (Desktop Bridge):
Match your packaging project's architecture to WACK's test target
This is the top cause of that "no tests matched" message. If you built your package for x64 but WACK is trying to run x86 tests (or vice versa), it won't find any valid test cases to execute. Here's how to align them:- Right-click your Windows Application Packaging Project in VS 2017, open Properties
- Switch to the Packaging tab, double-check the Architecture setting (e.g., x64)
- When launching WACK, make sure the test platform you select matches this architecture exactly—no mismatches allowed!
Update your SDK and WACK tool to compatible versions
VS 2017's Desktop Bridge packaging project is an older iteration, and compatibility issues with newer WACK versions (or outdated SDKs) can break test detection. Try these steps:- Open VS 2017's Tools > Get Tools and Features, and install the latest Windows 10 SDK available (aim for version 17763 or later, which corresponds to Windows 10 1809)
- Update WACK itself: Go to Settings > Apps, find Windows App Certification Kit, click Advanced options, then select Update
Rebuild and repackage your app from scratch
Corrupted intermediate build files can sometimes cause WACK to fail to recognize your package. Let's do a clean rebuild:- In VS 2017, click Build > Clean Solution to wipe all old build artifacts
- Next, run Build > Rebuild Solution to generate fresh binaries
- Repackage your app: Right-click the packaging project > Publish > Create App Packages, and follow the wizard to generate a new
.appxuploador.msixuploadfile
Manually point WACK to your package file
Sometimes launching WACK directly from VS can cause context issues. Try running WACK independently:- Navigate to WACK's install path (usually
C:\Program Files (x86)\Windows Kits\10\App Certification Kit\appcert.exe) - Run
appcert.exe, select Validate an app, then manually browse to your newly generated.appxor.msixpackage - Select the appropriate test suite and see if tests execute properly now
- Navigate to WACK's install path (usually
Verify your package manifest configuration
A misconfiguredPackage.appxmanifestcan also throw off WACK's test detection. Double-check these settings:- In the Identity tab, ensure Name, Publisher, and Version are correctly filled in—your Publisher ID must match the one linked to your Microsoft Store developer account
- In the Capabilities tab, only select the permissions your app actually needs (don't leave it blank, and don't add unnecessary capabilities)
Quick note: If you're running WACK on an older Windows 10 version (pre-1809), that could also be the culprit. Desktop Bridge features require a reasonably modern OS, so upgrading to Windows 10 1809 or later might resolve hidden compatibility issues.
内容的提问来源于stack exchange,提问作者Elkland Technologies

