1
votes

I have a UWP project with a test project. Locally test passes. I configured Azure DevOps pipeline for these projects. The test passes on azure DevOps as well! But the Test Task fails with next error:

DEP7100: Failed to activate app '748f39e5-19db-43a2-ba4a-fb4b137bdbf3_4r2k005x7atxw!vstest.executionengine.universal.App' with parameters '--port 50037 --endpoint 127.0.0.1:050037 --role client --parentprocessid 5044 --telemetryoptedin false'. The app didn't start.
The app didn't start.
DEP7100: Failed to activate app '748f39e5-19db-43a2-ba4a-fb4b137bdbf3_4r2k005x7atxw!vstest.executionengine.universal.App' with parameters '--port 50037 --endpoint 127.0.0.1:050037 --role client --parentprocessid 5044 --telemetryoptedin false'. The app didn't start.
The app didn't start.
App activation failed.
Failed to initialize client proxy: could not connect to test process.
DEP7100: Failed to activate app '748f39e5-19db-43a2-ba4a-fb4b137bdbf3_4r2k005x7atxw!vstest.executionengine.universal.App' with parameters '--port 50040 --endpoint 127.0.0.1:050040 --role client --parentprocessid 5044 --telemetryoptedin false'. The app didn't start.
The app didn't start.
DEP7100: Failed to activate app '748f39e5-19db-43a2-ba4a-fb4b137bdbf3_4r2k005x7atxw!vstest.executionengine.universal.App' with parameters '--port 50040 --endpoint 127.0.0.1:050040 --role client --parentprocessid 5044 --telemetryoptedin false'. The app didn't start.
The app didn't start.

Here you can find repo with UWP project and test project: https://dev.azure.com/melashkina0755/UWP_App_With_Tests

Here is the last build and you can see, that there were 2 tests and they passed (1 for x84 1 for x64): https://dev.azure.com/melashkina0755/UWP_App_With_Tests/_build/results?buildId=3&view=ms.vss-test-web.build-test-results-tab

And here is build itself: https://dev.azure.com/melashkina0755/UWP_App_With_Tests/_build/results?buildId=3&view=logs

Not sure what is wrong in my configuration?

UPDATE

I tried new things:

1) I created another brach with a self-hosted agent, it's called with_self_hosted_agent. The last build for this is here. As self-hosted agent I used my laptop. Build succeded, but tests didn't even run (no luck): https://dev.azure.com/melashkina0755/UWP_App_With_Tests/_build/results?buildId=10

2) I changed to only x86 architecture. Build for the only x86 is here (no luck): https://dev.azure.com/melashkina0755/UWP_App_With_Tests/_build/results?buildId=9

3) Tried version 1.3.1 on another branch called with_1.3.1_version. The same result as for master branch: tests are running, but the build is failed. (no luck): https://dev.azure.com/melashkina0755/UWP_App_With_Tests/_build/results?buildId=11

2

2 Answers

1
votes

From here: https://github.com/MicrosoftDocs/vsts-docs/issues/6108

It turned out, that there are 2 .appxrecipe files. One in the Release folder, another in the Upload folder. And the one, that is in the Upload folder is failing. And because of this build is failing. So the solution here is to use file only from the Release folder. YML file looks like this:

# Universal Windows Platform
# Build a Universal Windows Platform project using Visual Studio.
# Add steps that test and distribute an app, save build artifacts, and more:
# https://aka.ms/yaml

trigger:
- master

pool:
  vmImage: 'windows-latest'

variables:
  solution: '**/*.sln'
  buildPlatform: 'x86|x64'
  buildConfiguration: 'Release'
  appxPackageDir: '$(build.artifactStagingDirectory)\AppxPackages\\'

steps:
- task: NuGetToolInstaller@1

- task: NuGetCommand@2
  inputs:
    restoreSolution: '$(solution)'

- task: VSBuild@1
  inputs:
    platform: 'x86'
    solution: '$(solution)'
    configuration: '$(buildConfiguration)'
    msbuildArgs: '/p:AppxBundlePlatforms="$(buildPlatform)" /p:AppxPackageDir="$(appxPackageDir)" /p:AppxBundle=Always /p:UapAppxPackageBuildMode=StoreUpload'

- task: VSTest@2
  inputs:
    platform: 'x86|x64'
    testSelector: 'testAssemblies'
    testAssemblyVer2: |
      **\Release\UnitTestProject1.build.appxrecipe <-- HERE IS FIX
      !**\*TestAdapter.dll
      !**\obj\**
    searchFolder: '$(System.DefaultWorkingDirectory)'
0
votes

Azure DevOps | Test Task for UWP: DEP7100: Failed to activate app

According to the error log:

[error]App activation failed.
[error]Failed to initialize client proxy: could not connect to test process.

You can try to following steps in your test project file .csproj:

  • Change PackageReference to MSTest.TestAdapter and MSTest.TestFramework to version 1.3.1

  • Add

    <PropertyGroup>
      <RestoreProjectStyle>PackageReference</RestoreProjectStyle>
    </PropertyGroup> 
    

    in the test project file.

Check this thread for some more details.

Besides, I have noticed that you are using Microsoft hosted agents to build your projects, but according to the document Visual Studio 2019 Platform Targeting and Compatibility:

Universal Windows apps can be built from the command line when using Windows Server 2012 R2 or Windows Server 2016.

So, I not sure if we could run UWP apps on the Windows Server 2019.

As workaround, you could build your own agent on a Windows 10 machine.

Hope this helps.