The code inside that routine doesn't look like anything special. All it does is call out to the native Win 32 GetLogicalDrives method found in the kernel32.dll and return the results.
The rest of the code is pretty straight forward, so my guess is that it's getting caught up in the external method call and not returning. That means it's probably your machine getting jammed up - everyone else's will probably work. T. On Tue, May 18th, 2010 at 4:42 PM, "Maddin, Peter" <[email protected]> wrote: > Changing my code from > > originalFileName = String.Empty; > using (var csv = new CsvReader(new > StreamReader(fileName), true, Delimitor)) > { > > To > > originalFileName = String.Empty; > // open the file. It is expected to be a CSV file with > headers > using (var sr = new StreamReader(fileName)) > { > using (var csv = new CsvReader(sr, true, Delimitor)) > { > > Fixed nothing. I guess even if the second piece of code is correct, I > am a way off running out of window resources. > I am now sure the crap code is mine. So much for trying to blame > someone else. At least this issue identified another potential > problem. > > Copied the code into a small standalone winforms application with a > single button. > The isolated app also hangs. > > Will take the isolated app to another workstation. > > Then I will move on to trying out > Directory.GetLogicalDrives(); > > > Regards Peter Maddin > Applications Development Officer > PathWest Laboratory Medicine WA > Phone : +618 9473 3944 > Fax : +618 9473 3982 > E-Mail : [email protected] > The contents of this e-mail transmission outside of the WAGHS network > are intended solely for the named recipient's), may be confidential, > and may be privileged or otherwise protected from disclosure in the > public interest. The use, reproduction, disclosure or distribution of > the contents of this e-mail transmission by any person other than the > named recipient(s) is prohibited. If you are not a named recipient > please notify the sender immediately. > > > > > -----Original Message----- > From: [email protected] > [mailto:[email protected]] On Behalf Of Maddin, Peter > Sent: Tuesday, 18 May 2010 2:13 PM > To: [email protected]; ozDotNet > Subject: RE: DriveInfo.GetDrives() not returning > > Thanks Silky and Bill > > I was just going to isolate my code in a small standalone application > just prior to reading your missive. > > I thought their might be some lock in place but I only use this code > in one place. > The method is static. There is no means to close, shutdown or release > anything that I could find. > > Hmmmn, That made me think. This is a project that was started by > someone else. > > I just noticed they had (although they might deny it now that I have > been working on it). > > originalFileName = String.Empty; > using (var csv = new CsvReader(new > StreamReader(fileName), true, Delimitor)) > { > > That does not look right. The filestream will never be closed (at > least I don't think so) > > I have changed this to > > originalFileName = String.Empty; > // open the file. It is expected to be a CSV file with > headers > using (var sr = new StreamReader(fileName)) > { > using (var csv = new CsvReader(sr, true, Delimitor)) > { > > I will try this out after another reboot. > > I will also try out the Directory.GetLogicalDrives(); > If the above does not achieve anything. > > > Regards Peter Maddin > Applications Development Officer > PathWest Laboratory Medicine WA > Phone : +618 9473 3944 > Fax : +618 9473 3982 > E-Mail : [email protected] > The contents of this e-mail transmission outside of the WAGHS network > are intended solely for the named recipient's), may be confidential, > and may be privileged or otherwise protected from disclosure in the > public interest. The use, reproduction, disclosure or distribution of > the contents of this e-mail transmission by any person other than the > named recipient(s) is prohibited. If you are not a named recipient > please notify the sender immediately. > > > > > -----Original Message----- > From: [email protected] > [mailto:[email protected]] On Behalf Of silky > Sent: Tuesday, 18 May 2010 1:26 PM > To: ozDotNet > Subject: Re: DriveInfo.GetDrives() not returning > > On Tue, May 18, 2010 at 1:53 PM, Maddin, Peter > <[email protected]> wrote: > > [...] > > > I am targeting .NET 3.5. Is it a framework problem, driver problem, > some > > other problem? > > > > Could it just be the machine I am using? > > I know its boring but can you reproduce it in a stand-alone app? > (not > part of your main one?) > > My guess would be you're somehow in a lock with yourself. > > > > Regards Peter Maddin > > Applications Development Officer > > PathWest Laboratory Medicine WA > > Phone : +618 9473 3944 > > Fax : +618 9473 3982 > > E-Mail : [email protected] > > The contents of this e-mail transmission outside of the WAGHS > network are > > intended solely for the named recipient's), may be confidential, > and may be > > privileged or otherwise protected from disclosure in the public > interest. > > The use, reproduction, disclosure or distribution of the contents > of this > > e-mail transmission by any person other than the named recipient(s) > is > > prohibited. If you are not a named recipient please notify the > sender > > immediately. > > -- > silky > > http://www.programmingbranch.com/ > > >
