Home All Groups Group Topic Archive Search About

FileStream exception: unknown error

Author
1 Feb 2006 2:46 PM
Brecht Yperman
Hi,

Whenever a customer of ours runs our software on any of his laptops, we
get an IOException with an Unknown Error (-1) message at every call to
the System.IO.FileStream constructor.

This is really annoying, as none of our other customers have this
problem, and we have no information whatsoever about the error.

I looked into the SSCLI code and apparently on the CreateFile an
INVALID_HANDLE is returned, and a call to GetLastError returns -1. It
has nothing to do with permissions of security, I think, since

new FileIOPermission(secAccess, new String[] { filePath }, false,
false).Demand(); (filestream.cs, line 263)

doesn't throw an exception.

I can understand nobody can give me a "This is it"-answer, but could
someone please tell me how to debug a situation like this? This is
driving me insane...

Thanks,
Brecht

AddThis Social Bookmark Button