On certain machines, we've received the following error with the SystemDrive task when getting local drives:
Getting Drives from: SERVERNAME
1>D:\Path\To\Script.proj(585,2): error : IOException: The device is not ready.
Sample Task Usage:
<MSBuild.ExtensionPack.Computer.SystemDrive TaskAction="GetDrives">
<Output TaskParameter="Drives" ItemName="ExistingDrives" />
</MSBuild.ExtensionPack.Computer.SystemDrive>
This appears to be caused by the presence of a floppy drive (yes, we still have some of those!) without a disk inserted.
The SystemDrive task appears to loop over all of the logical drives and accesses their DriveInfo without first checking if the device is ready.
In order to avoid this issue, the IsReady property should be checked and/or IOException caught when accessing those members:
http://msdn.microsoft.com/en-us/library/system.io.driveinfo.isready.aspx
Comments: Resolved with changeset 75466.
Getting Drives from: SERVERNAME
1>D:\Path\To\Script.proj(585,2): error : IOException: The device is not ready.
Sample Task Usage:
<MSBuild.ExtensionPack.Computer.SystemDrive TaskAction="GetDrives">
<Output TaskParameter="Drives" ItemName="ExistingDrives" />
</MSBuild.ExtensionPack.Computer.SystemDrive>
This appears to be caused by the presence of a floppy drive (yes, we still have some of those!) without a disk inserted.
The SystemDrive task appears to loop over all of the logical drives and accesses their DriveInfo without first checking if the device is ready.
In order to avoid this issue, the IsReady property should be checked and/or IOException caught when accessing those members:
http://msdn.microsoft.com/en-us/library/system.io.driveinfo.isready.aspx
Comments: Resolved with changeset 75466.