Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
string path = Path.GetTempPath(); var driveInfo = new DriveInfo(path);
But doesn't crash on .NET Core.
On which platforms did you notice this
…13105) It's possible to pass any string as an argument to DriveInfo ctor (e.g. `new DriveInfo(Path.GetTempPath())`). Mono throws ArgumentException if there is no exactly the same drive name in the list of available drives. I tried to handle this case by extracting any valid drive name from the array of available drives sorted by path in descending order. Fixes #12157