NtfsLib icon indicating copy to clipboard operation
NtfsLib copied to clipboard

Cannot Run TestApplication and Failed Unit Tests ("Invalid Drive Name" and "Sequence contains no matching element")

Open chaojian-zhang opened this issue 5 years ago • 1 comments

Hi, I am trying to run TestApplication. I changed the first line from const char driveLetter = 'E' to const char driveLetter='C', and get this error while running:

Exception thrown: 'System.ArgumentException' in RawDiskLib.dll
An unhandled exception of type 'System.ArgumentException' occurred in RawDiskLib.dll
Invalid diskName: \\.\C:

Also, both NTFSDirectoryTests (3) and NTFSFileTests(3) failed because of the same exception at the line RawDisk disk = new RawDisk(driveLetter);.

Thanks!

chaojian-zhang avatar Aug 14 '19 16:08 chaojian-zhang

Solved. Run VS with Admin privilege and this problem will go away.

However the TestApplication and unit tests still cannot proceed, for unit tests it ran into exception System.InvalidOperationException: Sequence contains no matching element.

chaojian-zhang avatar Aug 14 '19 17:08 chaojian-zhang