在 Visual Studio 中调试时出现“驱动器中没有磁盘"错误 [英] 'No disk in the Drive' error when debugging in Visual Studio

查看:32
本文介绍了在 Visual Studio 中调试时出现“驱动器中没有磁盘"错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

每当我调试我的程序时,我有时会收到几个错误,要求我将磁盘插入驱动器 E 和驱动器 F.这似乎与 VS 寻找最初在这些驱动器上开发的第三方组件的来源有关驱动器,例如

Whenever I debug my program, I sometimes get several errors asking me to insert a disk into Drive E and Drive F. This seems to be something to do with VS looking for the source of Third Party components which were originally developed on these drives, for example

如果我一直按取消,那么我的调试会话会继续,但这很烦人.我该如何阻止这种情况发生?

If I keep pressing cancel, then my debugging session continues, but it is rather annoying. How do I stop this happening?

请注意,我尝试调试这些库,并且在选项/调试"下勾选了仅启用我的代码".

Note, I am not trying to debug these libraries, and I have 'Enable Just my Code' ticked under Options/Debugging.

推荐答案

这些 DLL 是在华盛顿州雷德蒙德的 Microsoft 构建服务器上构建的.Microsoft 通常配置这些构建服务器以在 F: 驱动器上找到它们的源代码.例如,.NET Framework 程序集是从 f:\dd 构建的,dd"是 DevDiv,Microsoft 负责开发人员工具的小组.在 DLL 内部,可以有一个部分,其中包含构建 DLL 时 DLL 的 PDB 文件的位置.

These DLLs were built on a Microsoft build server in Redmond, Washington State. Microsoft normally configures these build servers to find their source code on the F: drive. The .NET Framework assemblies for example were built from f:\dd, "dd" is DevDiv, the group at Microsoft that is responsible for developer tools. Inside the DLL, there can be a section that contains the location of the PDB file for the DLL at the time the DLL was built.

Unity 由 Microsoft 的另一个小组开发,称为模式和实践".值得注意的是使用相当糟糕的做法.DLL 中包含 PDB 位置的那部分应该被剥离,因为它是用于普通的 .NET Framework 程序集.您可以从消息中看出他们不使用 DevDiv 使用的普通构建服务器.

Unity is produced by another group at Microsoft, called "Patterns and Practices". Notable for using fairly poor practices. That section in the DLL that contains the PDB location should be stripped, as it is for normal .NET Framework assemblies. You can tell from the message that they don't use the normal build servers that DevDiv uses.

所以您看到的是该部分的内容,e:\Builds 是 Unity 的源代码最初所在的位置.所以这就是调试器将首先查找以再次找到 PDB 的地方.当然,它不会找到它,您不是在该构建服务器上调试您的代码 :) 这通常不会造成任何麻烦,调试器很快就会发现 PDB 不存在并继续搜索.首先查看符号缓存,然后从符号服务器下载PDB.

So you are seeing the content of that section, e:\Builds was where the source code for Unity was originally located. So that's where the debugger will look first to find the PDB again. Of course it isn't going to find it, you are not debugging your code on that build server :) That normally doesn't cause any trouble, the debugger quickly finds out that the PDB isn't there and continues searching. First looking in the symbol cache, downloading the PDB from the symbol server next.

不幸的是,在您的机器上,E: 驱动器实际上存在.但它处于不确定状态,驱动器号存在但实际上并未映射到功能驱动器.最常见的原因是您之前将该驱动器映射到网络共享,但网络连接不再有效.或者没有正确卸载的闪存驱动器.因此,当 Windows 看到一个程序试图访问驱动器时,它会介入并生成一个低级提示,让您有机会重新建立驱动器连接.它是臭名昭著的 MS-Dos 中止、重试、失败?" 提示.

Unfortunately on your machine, the E: drive in fact exists. But it is in limbo, the drive letter exists but it isn't actually mapped to a functional drive. The most common cause is you previously having mapped that drive to a network share but the network connection no longer being functional. Or a flash drive that wasn't properly dismounted. So Windows steps in when it sees a program trying to access the drive and generates a low-level prompt to give you an opportunity to re-establish the drive connection. It is the GUI version of the notorious MS-Dos "Abort, Retry, Fail?" prompt.

你当然不想要这个.因此,只需禁用驱动器,Windows 就可以让您安心.单击桌面上的计算机"快捷方式,右键单击 E: 驱动器并选择(我忘记了确切的命令)断开连接或禁用使驱动器消失.

You don't want this of course. So just disable the drive so Windows leaves you in peace. Click the "Computer" shortcut on your desktop, right-click the E: drive and select (I forget the exact command) Disconnect or Disable so the drive disappears.

如果这最初是映射的网络驱动器,最佳做法是遵循 Windows 建议,它自下而上映射驱动器,从 Z: 驱动器开始.如果驱动器号有另一个来源(我认为有些机器将读卡器映射到该驱动器号),然后在 superuser.com 上跟进以了解如何摆脱这些非功能性驱动器映射.他们可能还会告诉您是否有办法完全摆脱此提示,应该有.

In case this was originally a mapped network drive, the best practice is to follow the Windows recommendation, it maps drives from the bottom up, starting at the Z: drive. If the drive letter had another source (I think some machines map the card readers to that drive letter) then follow up at superuser.com to find out how to get rid of these non-functional drive mappings. They can probably also tell you if there's a way to get rid of this prompt completely, there ought to be one.

这篇关于在 Visual Studio 中调试时出现“驱动器中没有磁盘"错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆