I am trying to get the name of a network drive (the relative path will not work with File.Copy). I found this stackoverflow page that suggests using DriveType. I'm having an issue with my project not recognizing the class. The Microsoft page says it is part of the current framework, I've got a using statement for System.Management, and I've got my target framework set at 4.6.1.
- Is there something I'm missing that is preventing me from using this class?
- Is there a better way to get the network drive path so File.Copy will work?
As Hans Passant says above, in Visual Studio right click your project in Solution Explorer and choose Add Reference. From the .NET tab choose System.Management.