Windows runtime 从命令行使用vstest.console.exe运行WinRT单元测试时出现开发人员许可证错误

Windows runtime 从命令行使用vstest.console.exe运行WinRT单元测试时出现开发人员许可证错误,windows-runtime,mstest,Windows Runtime,Mstest,当我尝试从命令行执行WinRT MSTests时,出现以下错误: EXEC : error : Could not start test run for unit tests for Windows Store app: No valid developer license found for running unit tests for Windows Store apps. Please install/renew your developer license.. 这曾经奏效,但突然开始失

当我尝试从命令行执行WinRT MSTests时,出现以下错误:

EXEC : error : Could not start test run for unit tests for Windows Store app: No valid developer license found for running unit tests for Windows Store apps. Please install/renew your developer license..
这曾经奏效,但突然开始失败。奇怪的是,它们在VisualStudio中执行得很好

我正在使用以下MSBuild任务

<Target Name="UnitTest" DependsOnTargets="Compile" >
       <ItemGroup>
        <TestAppx Include="$(SolutionDir)\**\*x86*\**\*Tests*.appx" />
       </ItemGroup>

    <Message Importance="high" Text="Running tests for %(TestAppx.Identity)" />

    <Exec Command='"$(VSINSTALLDIR)\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe" %(TestAppx.Identity) /InIsolation /platform:x86 /Logger:trx /UseVsixExtensions:true'
          WorkingDirectory="$(SolutionDir)"/>
</Target>

仍然不确定为什么VisualStudio和vstest不同步,但我找到了解决方案

  • 以管理员身份打开PowerShell
  • 执行:注销WindowsDeveloperLicense
  • 在VisualStudio中打开解决方案
  • 当提示您重新创建开发者许可证时,请登录您的live帐户
资料来源: