3

When I run Visual Studio Professional 2013 under my regular user account, I can debug/test ASP.NET applications but I can't run the unit tests for some reason. It looks like it discovers the unit tests at first ("Discover tests finished: 4 found") but then doesn't run them ("no tests found to run").

When I run VS as administrator, it works. I got the idea from Why does visual studio 2012 not find my tests? but the answers don't explain why it makes a difference. Running unit tests doesn't seem like something that should require admin rights.

Community
  • 1
  • 1
wrschneider
  • 16,836
  • 14
  • 84
  • 162

1 Answers1

1

Why do I need to run as administrator for unit tests to work

It depends on the nature of your test cases.

Why Visual Studio should run as an Administrator.

  • Developing for Windows Azure
  • Coded UI tests
  • Using IIS with web application
  • Developing with WCF Profiling
  • Installing updates for various extensions (like NuGet)

You can set devenv.exe to Run as Administrator under Properties and Compatibility tab as a workaround.

CharithJ
  • 44,463
  • 20
  • 111
  • 128
  • I'm not sure those apply - I have unit tests for a controller that are just making normal method calls and assertions. – wrschneider Jul 20 '15 at 13:54
  • @wrschneider: May be a VS bug... https://connect.microsoft.com/VisualStudio/feedback/details/807771/visual-studio-2013-test-explorer-only-works-if-run-as-administrator – CharithJ Jul 21 '15 at 11:15