Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to keep Visual Studio from modifying the solution file after every test run?

Visual Studio seems to be modifying a list of .vsmdi files in my .sln every time sometimes when I run a unit test. This is annoying because my source control client thinks the .sln file needs to be checked in even though I don't want to check it in. Is there any way to keep Visual Studio from munging the .sln file after a test run?

Edit: Found a Microsoft Connect issue discussing this, which sucks because things just sort of disappear from there after a little while and its a terrible bug tracker

like image 233
Luke Avatar asked Oct 01 '08 22:10

Luke


People also ask

How do I run a clean solution in Visual Studio?

To build, rebuild, or clean an entire solution Choose Build All to compile the files and components within the project that have changed since the most recent build. Choose Rebuild All to "clean" the solution and then builds all project files and components. Choose Clean All to delete any intermediate and output files.

What does it mean to clean a solution Visual Studio?

Choose Clean Solution to delete any intermediate and output files. With only the project and component files left, new instances of the intermediate and output files can then be built.

What is the purpose of the * .sln file in Visual Studio projects?

SLN extension represents a Visual Studio solution file that keeps information about the organization of projects in a solution file. The contents of such a solution file are written in plain text inside the file and can be observed/edited by opening the file in any text editor.

How many projects can a Visual Studio solution have?

Some authors propose a number between 15-20 maximum projects in a Visual Studio Solution to be a good compromise.


1 Answers

I don't believe a solution exists. A good Connect case, that does a better job of documenting the issue and a repro case, is this one. At the very bottom of the page a commenter proposes a workaround, which I've reproduced here. I haven't actually tested this workaround for myself yet, I guess I've gotten numb to discarding the changes caused by this bug :(

From the connect case:

I have been able to repro this problem by having developer A run tests with the vsdmi file while developer B check it out and adds unit tests to the vsdmi. This typically will cause a new one to be generated.

The workaround that has worked for me is to create vsdmi files per dev for unit testing activities that are not checked in to SCC and create special vsdmis for build testing and automated regression.

Yuck, but it works.

like image 59
Seth Petry-Johnson Avatar answered Oct 06 '22 19:10

Seth Petry-Johnson