none
Encounter "No disk" error when accessing the disk RRS feed

  • Question

  • Hello,

    We encountered the following error in our .net code.

    Based on my experience, I consider that the root cause is that the removable disk, which connects to the device "\Device\Harddisk2\DR4", disconnects or is unable to access now. However, the disk letter (e.g. D: or E:) is not released and we can still access it on the computer.

    Our goal is to handle the error in our code. In another word, we hope we can capture the exception in custom code and let the dialog disappear. I double checked the code and ensure that all relative IO in this period is wrapped with try-catch block and handle all exception. I researched the solution on Internet, and none of them hits the bull's eye. Therefore, you can provide me a possible solution on this issue.

    Any suggestion will be appreciated.

    Thanks,

    Edward

    Saturday, September 29, 2012 5:58 AM

Answers

  • This is generic action prompt generated by Win32 I/O calls to a drive that is inaccessible but support "Eject"/"Remove". The .NET runtime won't trap this because this is not yet considered an error at this point.

    You best option is to query the drive's type and status before using it.

    • Marked as answer by Edward Zhu Monday, October 8, 2012 2:35 AM
    Monday, October 8, 2012 2:30 AM
    Answerer

All replies

  • Can you identify in your code where the problem occurs? I'm assuming that while the dialog is present, your program is blocked, so a debugger should help you point to what .NET function is causing the dialog to show. Perhaps there are some options or other behaviour that needs to be tweaked. Then I think others who read this forum can also help.
    • Proposed as answer by Mike FengModerator Wednesday, October 3, 2012 10:38 AM
    • Unproposed as answer by Edward Zhu Monday, October 8, 2012 1:37 AM
    Sunday, September 30, 2012 8:16 AM
  • Hi Jason,

    Thanks for your response. I just came back from my vacation.

    This issue only occurs occasionally. After we restart the computer, the issue is gone, and we cannot reproduce this issue now. The scene does not exist any more. We may try to debug it when the issue re-happen.

    Thanks,

    Edward

    Monday, October 8, 2012 1:46 AM
  • This is generic action prompt generated by Win32 I/O calls to a drive that is inaccessible but support "Eject"/"Remove". The .NET runtime won't trap this because this is not yet considered an error at this point.

    You best option is to query the drive's type and status before using it.

    • Marked as answer by Edward Zhu Monday, October 8, 2012 2:35 AM
    Monday, October 8, 2012 2:30 AM
    Answerer
  • Thanks, cheong.

    I will try this and hope it can work on my side. However, I cannot verify it now, since the scenario occurs quite occasionally. Your response is still useful to us.

    Thanks again,

    Edward

    Monday, October 8, 2012 2:35 AM