Can't run Unit Tests In VS2012RC

2019-08-07 06:53发布

问题:

I'm trying to run my unit tests for a Windows 8 Metro Class library i get the following 2 errors in the output window:

Output:

------ Run test started ------ 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.

Failed to activate Metro style unit test executor. Error: The application cannot be started. Try reinstalling the application to fix the problem.
========== Run test finished: 0 run (0:00:01.2818304) ==========

Other output:

------ Discover test started ------ ========== Discover test finished: 7 found (0:00:00.6471091) ========== ------ Run test started ------ Failed to activate Metro style unit test executor. Error: The application cannot be started. Try reinstalling the application to fix the problem. ========== Run test finished: 0 run (0:00:02.0105835) ==========

Has anybody run into the problem?

Unit tests in other Win8 class librarys or apps works fine.

I think it's something with the solution. Yesterday everything went fine. I guess there was a Windows update, maybe that screwed things up?

Things i've tried:

  • Uninstalled R#
  • Reinstalled Visual Studio 2012 RC
  • Tried unit tests in other class library (works)
  • Tried unit tests in Windows 8 app (works)
  • Cleaned / Rebuild solution
  • Debug and Release Configuration
  • Added another Test project to the solution and unload other project(works)

Techincal Specs:

  • Visual Studio 2012 RC Version: 11.0.50522.1
  • Windows 8 RC Build 8400
  • 64 Bit OS
  • Had resharper 7, Uninstalled it.

回答1:

I had the same problem, but when I set the build configuration to x86 (Configuration Manager, Active Solution Platform) it suddenly works. If I set the configuration to AnyCPU or x64, I get the "Failed to execute..." error.
I belive the test executer is a 32-bit application and it can not load a 64-bit library.