Wednesday, September 1, 2010

Message in Visual Studio 2010: Changes to your tests are no longer automatically displayed

Today I had one of these dispensable experiences when working with computers. Things that I've had done again and again before, and knew they usually work, showed weird results.

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 reason

Looking 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 solution

Now 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.

12 comments:

  1. 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
  2. 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 suspicion

    ReplyDelete
  3. Great to hear it helped at least two people out there! :)

    ReplyDelete
  4. This assisted with a bug I was having in ReSharper

    See: http://youtrack.jetbrains.net/issue/RSRP-157098

    ReplyDelete
  5. "Great to hear it helped at least two people out there! :)"

    make that three.

    ReplyDelete
  6. 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
  7. 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
  8. 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
  9. 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