Validate an app package in automated builds by using Team Foundation Server
[This documentation is preliminary and is subject to change.]
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
Unload the project file to make it editable.
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"> <ReadLinesFromFile Condition="Exists($(AppxPackagingInfoFile))" File="$(AppxPackagingInfoFile)"> <Output TaskParameter="Lines" PropertyName="AppxPackagingOutputForWinACK" /> </ReadLinesFromFile> <Exec Command=""$(TargetPlatformSdkPath)App Certification Kit\appcert.exe" reset" /> <Exec Command=""$(TargetPlatformSdkPath)App Certification Kit\appcert.exe" test -apptype windowsstoreapp -packagefullname "$(AppxPackagingOutputForWinACK)" -reportoutputpath "$(ProjectDir)$(outdir)ValidationResult.xml"" /> <Exec Command="copy "$(userprofile)appdata\Local\Microsoft\appcertkit\ValidationResult.htm" "$(ProjectDir)$(outdir)ValidationResult.htm"" /> </Target>
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.
Automate your builds by using the guidance in the following topic: Build and test a Windows Store app using Team Foundation Build.
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.
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.