Why does Visual Studio create a new .vsmdi file?

Visual Studio-2010Visual StudioVisual Studio-2008Mstest

Visual Studio-2010 Problem Overview


If I open a solution in Visual Studio 2008 and run a unit test then VS creates a new .vsmdi file in the Solution Items folder and gives it the next number available e.g. My Solution2.vsmdi.

Any idea why VS is doing this and how I can get it to stop doing this?

Visual Studio-2010 Solutions


Solution 1 - Visual Studio-2010

It appears that the VSMDI problem is a known bug and has been around since VS2005 Team System but it has no clear fix as yet. Another reason to NOT use MS Test.

An MSDN blog details how to run unit tests without VSMDI files.

Solution 2 - Visual Studio-2010

Assuming that the VSMDI file is under source control, here's a Microsoft Support article about this issue: Multiple vsmdi Files after Running Team Test with VSMDI file under Source Control

Which says:

Someone ran a test while someone else was modifying the vsmdi file. Team Test detects that the VSMDI file is out of sync;therefore, Team Test it makes one and thus you see the incrementing vsmdi files.

And:

Going forward you want to make sure the file is not marked for auto checkout when it is modified. When the current tester has the VSMDI file checked out you, do not want other users to be able to check it out. You want your developers to checkout the file, run a test, and check it back in.

Solution 3 - Visual Studio-2010

I work around this by always checking out the .vsmdi.
It seems that this only happens when the .vsmdi file is read-only, e.g. not checked-out in a version control system that uses that kind of lock-local-files behavior (Perforce etc).

Solution 4 - Visual Studio-2010

An old post but vsmdi is a meta data file created by the test system.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionGuyView Question on Stackoverflow
Solution 1 - Visual Studio-2010Jon LimjapView Answer on Stackoverflow
Solution 2 - Visual Studio-2010Hans OlssonView Answer on Stackoverflow
Solution 3 - Visual Studio-2010NiklasView Answer on Stackoverflow
Solution 4 - Visual Studio-2010JamesSugrueView Answer on Stackoverflow