Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

'No disk in the Drive' error when debugging in Visual Studio

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

enter image description here

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.

like image 308
sgmoore Avatar asked Jun 07 '14 10:06

sgmoore


People also ask

How do I enable debugging in Visual Studio?

In the Visual Studio toolbar, make sure the configuration is set to Debug. To start debugging, select the profile name in the toolbar, such as <project profile name>, IIS Express, or <IIS profile name> in the toolbar, select Start Debugging from the Debug menu, or press F5.

How do I set debug path in Visual Studio?

In Solution Explorer, right-click the project and choose Properties. In the side pane, choose Build (or Compile in Visual Basic). In the Configuration list at the top, choose Debug or Release. Select the Advanced button (or the Advanced Compile Options button in Visual Basic).


2 Answers

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 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.

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.

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.

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.

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.

like image 144
Hans Passant Avatar answered Oct 11 '22 17:10

Hans Passant


I have found that closing the solution and deleting the .suo files works when this happens to me. Though I usually don't get the comment about a specific DLL, just the drive so this may not be the exact same problem.

like image 23
user3228938 Avatar answered Oct 11 '22 18:10

user3228938