Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio 2012 Not Recognizing Existing Unit Tests

I previously created a Unit Test Project then removed it from my solution temporarily. Now that I have added it back, my unit tests aren't being detected by Visual Studio and I can't figure out how to run them.

I was looking online and I saw that there are some solutions regarding the "Test Tools" settings, but it seems to have been removed in VS 2012.

Has anyone encountered this problem? How can I fix it so I can run my unit tests again?

like image 688
corgichu Avatar asked Jul 13 '26 15:07

corgichu


1 Answers

A possible cause, mentioned in the comments by AH. and Johnathon Sullinger is an incorrect signature of asynchronous unit tests - the return type must be a task and cannot be void.


Also make sure the test project is checked in the appropriate build configuration:

Go to the Configuration Manager and tick the check box for your test project under your current build configuration. Make sure to rebuild the solution afterwards (as correctly pointed out by Dustin Venegas in the comments).

enter image description here enter image description here

like image 182
BartoszKP Avatar answered Jul 15 '26 06:07

BartoszKP