ManagementPath Class not working

724 views Asked by At

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.

  1. Is there something I'm missing that is preventing me from using this class?
  2. Is there a better way to get the network drive path so File.Copy will work?
1

There are 1 answers

0
dotnetdanny On

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.