visual-studio 为什么 Visual Studio 创建一个新的 .vsmdi 文件?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/28171/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Why does Visual Studio create a new .vsmdi file?
提问by Guy
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.
如果我在 Visual Studio 2008 中打开一个解决方案并运行单元测试,那么 VS 会在解决方案项目文件夹中创建一个新的 .vsmdi 文件,并为其提供下一个可用编号,例如 My Solution2.vsmdi。
Any idea why VS is doing this and how I can get it to stop doing this?
知道为什么 VS 这样做以及我如何让它停止这样做吗?
采纳答案by Jon Limjap
It appears that the VSMDI problem is a known bug and has been around since VS2005 Team Systembut it has no clear fix as yet. Another reason to NOT use MS Test.
VSMDI 问题似乎是一个已知错误,自 VS2005 Team System 以来就存在,但目前还没有明确的修复方法。另一个不使用 MS 测试的原因。
An MSDN blog details how to run unit tests without VSMDI files.
MSDN 博客详细介绍了如何在没有 VSMDI 文件的情况下运行单元测试。
回答by Hans Olsson
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
假设 VSMDI 文件受源代码管理,这里有一篇关于此问题的 Microsoft 支持文章:使用源代码管理下的 VSMDI 文件运行团队测试后的多个 vsmdi 文件
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.
当其他人正在修改 vsmdi 文件时,有人运行了测试。Team Test 检测到 VSMDI 文件不同步;因此,Team Test 会生成一个文件,因此您会看到不断增加的 vsmdi 文件。
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.
展望未来,您要确保文件在修改时未标记为自动检出。当当前测试人员将 VSMDI 文件检出时,不要希望其他用户能够检出它。您希望您的开发人员签出文件,运行测试,然后重新签入。
回答by Niklas
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).
我总是通过检查 .vsmdi 来解决这个问题。
似乎这仅在 .vsmdi 文件为只读时发生,例如未在使用这种锁定本地文件行为(Perforce 等)的版本控制系统中检出。
回答by JamesSugrue
An old post butvsmdi is a meta data file created by the test system.
一个旧帖子,但vsmdi 是由测试系统创建的元数据文件。

