2

我的经验,这奇怪的错误尝试从Visual Studio中的WinRT运行单元测试2012试图运行的WinRT单位时遇到“DEP3000”错误测试

Error: DEP3000: Attempts to stop the application failed. This may cause the deployment to fail. App Packages may only be shutdown as part of a Visual Studio build operation

我完全不明白什么能意思?我尝试重新启动计算机并重新安装开发人员许可证。我如何重现它,我只是从Visual Studio模板创建一个新的空单元测试项目。我根本不涉及这个项目。但是,当我尝试对其执行运行测试时,它只是说暂时待命一段时间,然后吐出该错误

如何解决此问题?

规格:Windows 8的企业64位时,Visual Studio 2012年更新2

而且,我已经看到了this question约VS2012RC,但答案似乎并不适用。我试过每个配置都有这个错误

+0

使用任务管理器,详细信息选项卡。看看你是否可以杀死单元测试运行器的运行实例。 – 2013-05-04 00:11:57

回答

1

当我使用VS upgrade2并使用Resharper 7.1.1来运行unittests时,我遇到了同样的问题。事实证明,您需要将Resharper升级到7.1.3 - 或者使用VS测试浏览器运行测试。

+0

YUP,这是博客文章:http://blogs.jetbrains.com/dotnet/2013/04/resharper-713-is-available-for-visual-studio-2012-update-2/ – thomasnguyencom 2013-05-12 03:04:42

0

你可以只尝试使用XUnits应用: https://channel9.msdn.com/Shows/demooftheday/xunit-in-uwp

有了这个测试将在的xUnit的测试应用程序运行,而不是在VS测试资源管理器。

在我的单元测试项目的project.json

{ 
"dependencies": { 
     "Microsoft.NETCore.UniversalWindowsPlatform": "5.1.0", 
     "xunit": "2.1.0", 
     "xunit.runner.devices": "2.1.0" }, "frameworks": { 
     "uap10.0": { } }, "runtimes": { 
     "win10-arm": { }, 
     "win10-arm-aot": { }, 
     "win10-x86": { }, 
     "win10-x86-aot": { }, 
     "win10-x64": { }, 
     "win10-x64-aot": { } } 
} 

然后转到名为UnitTestapp.xaml单元测试项目中的XAML文件,并将其更改为

<ui:RunnerApplication 
    x:Class="UnitTestProject1.App" 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:local="using:UnitTestProject1" 
    xmlns:ui="using:Xunit.Runners.UI" 
    RequestedTheme="Light"> 
</ui:RunnerApplication> 

当然,在后面的代码:

sealed partial class App : RunnerApplication 
    { 
    protected override void OnInitializeRunner() 
    { 
     AddTestAssembly(GetType().GetTypeInfo().Assembly); 
     InitializeRunner(); 
    } 
    partial void InitializeRunner(); 
    }