有没有一种方法可以防止Visual Studio在每次测试运行后修改解决方案文件?
时间:2020-03-06 15:00:05 来源:igfitidea点击:
有时,当我运行单元测试时,Visual Studio似乎每次都在.sln中修改.vsmdi文件列表。这很烦人,因为我的源代码控制客户端认为即使我不想检入.sln文件,也需要检入。是否有任何方法可以阻止Visual Studio在测试运行后清除.sln文件?
编辑:发现了一个讨论此问题的Microsoft Connect问题,这很烂,因为不久之后事情就从那里消失了,并且它是一个糟糕的错误跟踪器
解决方案
编辑:糟糕,对" vsmdi文件列表"一事感到困惑。建议是行不通的。
这是一个年龄的问题...我总是在提交更改之前检查解决方案是否由于某种原因被检出。
我认为不存在解决方案。这是一个很好的Connect案例,它可以更好地记录问题和repro案例。在页面的最底部,评论者提出了一种解决方法,我已在此处转载。我还没有为我自己实际测试过这种解决方法,我想我已经麻木了,放弃了由该错误引起的更改:(
从连接情况:
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.