what can cause System.IO.IOException besides for HD errors?

  • Thread starter Thread starter Zytan
  • Start date Start date
Z

Zytan

I got a System.IO.IOException in my app on another computer, so I
couldn't debug it. I don't think it was a HD error. What else could
throw this? Could it be from reading a webpage from the internet
through a stream?

Zytan
 
Zytan said:
I got a System.IO.IOException in my app on another computer, so I
couldn't debug it. I don't think it was a HD error. What else could
throw this? Could it be from reading a webpage from the internet
through a stream?

Well, what was the message from the IO exception?
 
From the documentation:

IOException is the base class for exceptions thrown while accessing
information using streams, files and directories.

The Base Class Library includes the following types, each of which is a
derived class of IOException :

a.. DirectoryNotFoundException

b.. EndOfStreamException

c.. FileNotFoundException

d.. FileLoadException

e.. PathTooLongException

Where appropriate, use these types instead of IOException.

So in your case, reading from a network stream could definitely do it.
Like Jon said, what's the message that is in the IOException instance?
 
[...] What else could
throw this? [...]

I hate to be a wise guy here but if any .NET-app could throw a
System.IO.IOException. It would be meaningless in most cases and
probably not the answer you are looking for, but still...

Example:

using System;
class Program
{
static void Main(string[] args)
{
throw new System.IO.IOException("foo");
}
}

/Per
 
Well, what was the message from the IO exception?

Wouldn't I love to know! The windows error report window doesn't show
it.

Zytan
 
IOException is the base class for exceptions thrown while accessing
information using streams, files and directories.
So in your case, reading from a network stream could definitely do it.
Like Jon said, what's the message that is in the IOException instance?

Yes, that's exactly what I was thinking. I don't know the message, I
wish I knew it! The Windows error report doesn't show it.

I put in an exception handler for my http accessing via stream, since
I believe that's where it came from, so I'll know next time.

Thanks,
Zytan
 
[...] What else could
throw this? [...]

I hate to be a wise guy here but if any .NET-app could throw a
System.IO.IOException.

Yes, that's true. But, I don't so this myself, and I don't use 3rd
party code, so some .NET library function threw this. I was just
wondering what type of functions that may be. I've got my answer,
now.

Most of my HD accessing is handled, and I just added exception
handling to the rest. So, that may have been my problem, maybe it was
a file being written. I assumed it wasn't since the HD has tons of
free space.

Zytan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top