Windows apps
Collapse the table of content
Expand the table of content

Validating an app package in automated builds (Windows Store apps)

By validating an app whenever you build it, you can help ensure that it will pass the validation tests that Windows Store requires when you publish an app. If you're using Team Foundation Build, you can update the project files and modify settings on the build machine so that the validation tests in the Windows App Certification Kit (ACK) run automatically. In addition, you don’t need to change any build definitions.

To integrate Windows ACK validation with Team Foundation Build

  1. Unload the project file to make it editable.

  2. Copy the following PostPackageEvent target, and then paste it near the end of the file, next to the pre-build and post-build targets.

    <Target Name="PostPackageEvent" AfterTargets="_GenerateAppxPackage">
       <Exec Command="&quot;$(TargetPlatformSdkPath)App Certification Kit\appcert.exe&quot; reset"/>
       <Exec Command="&quot;$(TargetPlatformSdkPath)\App Certification Kit\appcert.exe&quot; test -apptype windowsstoreapp -AppxPackagePath &quot;$(FinalAppxPackage)&quot; –reportoutputpath &quot;$(outdir)\ValidationResult.xml&quot;" />
       <Exec Command="copy &quot;$(userprofile)\appdata\Local\Microsoft\appcertkit\ValidationResult.htm&quot; &quot;$(outdir)\ValidationResult.htm&quot;"/>

    The output file, ValidationResult.xml, will be written to the path in –reportoutputpath. If you specify a static location rather than $(outdir), ensure that the directory exists before you queue the build, and delete the output file before you queue the build again.

  3. On the build machine, open the Team Foundation Server Administration Console.

  4. On the Build Configuration page, choose the Build Service Properties link.

    The Build Service Properties dialog box opens.

  5. In the Run the service as text box, specify an account that has administrator permissions on the build machine, and then select the Run the Service Interactively check box.

    If you select that check box, the build service can launch other apps as needed.

  6. When you start the build service on the build machine, run %ProgramFiles%\Microsoft Team Foundation Server 11.0\Tools\TFSBuildServiceHost.exe with administrative permissions.

  7. Queue the build.

  8. When the build finishes, review the test results in the ValidationResult.htm file. The test results appear in the last entry of the PostPackageEvent target that you previously pasted into the ValidationResult.htm file.

    Important note Important

    The build doesn’t pass or fail based on the result of the validation. You must view the test results to know whether the app has validation errors.

© 2017 Microsoft