Every time I made a change in a test (MSTest) in Visual Studio 2010, a message box popped up:
Changes to your tests are no longer automatically displayed. Click Refresh to display your changes in the Test View or Test List Editor.
Yes, thanks. But - why? I've changed tests many times before, but that message was totally new to me.
Additionally, in Test View a new message showed up in the notification area:
Changes were made to the tests, click Refresh to update.
Every time I pressed the Refresh button, the solution was built but the list of tests in the Test View did not always refresh properly.
Moreover, the testrunner in my beloved ReSharper failed on running new unit tests:
That showed the direction to the problem: the new test was written, but the testrunner can't find it? Well, then the test did not make it from the code to the assembly. Looks as if the assembly has not been built properly.
The reasonLooking into the current configuration unveiled the reason: the test project was not configured to be included in the build for the current configuration. So, I could type as many tests I wanted, they never made it to the assembly to be actually run.
The solutionNow the solution was easy. I just had to configure the current configuration to also build the test project.
For that call the configuration manager:
and check the Build checkbox for the test project.
Since I could not find anything on the web regarding that topic, I hope this post can help some desperate minds.
Thank you, your blog post was the only result for that message and thanks to it I was able to resolve this problem rather quickly.ReplyDelete
Thank you, this worked for me. I saw it saying "1 skipped" in the build log, and was going to change it, but you confirmed my suspicionReplyDelete
Great to hear it helped at least two people out there! :)ReplyDelete
This assisted with a bug I was having in ReSharperReplyDelete
"Great to hear it helped at least two people out there! :)"ReplyDelete
make that three.
My test project IS already marked for build and still I get the annoying messagebox and the notification in the test view. What I do not understand - the vs coders write code to show a notification bar to tell you that you have to click the refresh-button. couldn't they simply do this by code themselves? buttonRefresh_Clicked(this, null) would be my favourite solution for this problem...ReplyDelete
Fixed it for me too. Thanks!ReplyDelete
It's very weird, this message appeared when i open VS and all my tests from test list were put in "Test not in list" list, but i didnt put them there...ReplyDelete
This happened to me, I manually deleted all of the bin folders from my solution by filtering on =bin in Win7. Rebuild and runner worked fine.ReplyDelete
Thank for posting this. Seems to be easy to figure out but I was struggling with this for 2 hours. Thanks for saving me some time!ReplyDelete