Invalid disk name while creating object of RawDiskLibrary

1

I am trying to use NTFS to search files from my drive, for which I faced the attached exception while trying to create object of RAWDiskLibrary. I have C, D, E drives and having this issue while I select any of the drives. Please help me in this regard.

Exception details: Code: const char driveLetter = 'E'; RawDisk disk = new RawDisk(driveLetter); Exception:

                System.ArgumentException
                HResult=0x80070057
                Message=Invalid diskName: \\.\E:
               `enter code here` Source=RawDiskLib

Thanks

https://i.stack.imgur.com/VlsgK.jpg

c#
exception
ntfs
invalidargumentexception
asked on Stack Overflow Jan 6, 2019 by Adeel Kamran

2 Answers

0

Try it first for ensure if E is a valid drive letter:

var drives = Utils.GetAllAvailableVolumes();

The full example is here EX

answered on Stack Overflow Jan 6, 2019 by Piotr Ryszard
0

Run the visual studio as administrator. It will work :-).

answered on Stack Overflow Jan 7, 2019 by Hassan Rahman

User contributions licensed under CC BY-SA 3.0