0

I am using vb.net (framework 2.0) to develop a console application on Windows which I want to then run under Mono on Debian as well. I am using System.IO.DriveInfo to get the free space on a USB flash drive. Under Windows this works fine:

Dim drv As New System.IO.DriveInfo("I:\")

On Linux this generates an exception:

Dim drv As New System.IO.DriveInfo("/mnt/usb_flash")

It appears from googling that DriveInfo is not well implemented under Mono.

How can I get the free space from a USB flash drive in VB.NET under Mono?

Thanks.

Guy
  • 413
  • 6
  • 20
  • Already answered at http://stackoverflow.com/questions/2168191/functions-for-system-status-c-sharp – Andrew Morton Sep 11 '12 at 18:40
  • Which exception do you get? And try prepending a slash: Dim drv As New System.IO.DriveInfo("/mnt/usb_flash") – Rolf Bjarne Kvinge Sep 11 '12 at 21:01
  • Rolf - Sorry, that is just my typo, in the working code the actual path is passed in as an argumentand includes the root slash. – Guy Sep 12 '12 at 08:16
  • Andrew - Hmm...so I need to install and reference the Mono framework in order to use Mono.Unix.DriveInfo. Can I reference Mono framework as well as dot net or must I switch from one to the other? – Guy Sep 12 '12 at 08:21

0 Answers0