On "some client's computer" the folowing C# code:
==
XmlDocument doc = new XmlDocument();
...
doc.Save(Application.LocalUserAppDataPath + "config.config");
==
throw the following error:
==
Exception : System.IO.IOException
Message : Unknown error "-1".
Stack :
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess
access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize,
FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean
bFromProxy)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess
access, FileShare share)
at System.Xml.XmlDocument.Save(String filename)
==
The disk is not full, look at the directory and error, obviously everything
should be fine.
I would like to complain to Microsoft.
However I could foresee the answer from support:
"There is not enough information for use to do anything about it, case
closed."
Now I don't know what to do!
I played with interop and wrote some code to create a minidump
( inspired by this blog entry
http://blogs.msdn.com/greggm/archive/2004/08/14/214725.aspx )
but when I try to open some MiniDump I generated for fun from C# (i.e. no
real exception,just a button click), all I get is
==
> *ntdll.dll!00000000773d082a()
[Frames below may be incorrect and/or missing, no symbols loaded for
*ntdll.dll]
*kernel32.dll!000000007727ed73()
==
not even my C# calls are present... (I generated with all dump information,
but without exception info, obviously)
Any tip on how to generate meaningfull information (from C#) for Microsoft
Support to be able to help me on this issue?
Willy Denoyette [MVP] - 09 May 2007 10:00 GMT
> On "some client's computer" the folowing C# code:
> ==
[quoted text clipped - 45 lines]
> Any tip on how to generate meaningfull information (from C#) for Microsoft
> Support to be able to help me on this issue?
The error doesn't mean that the disk is full, "Unknown error "-1"" is a
generic error message, indicating that the error is not handled by the Init
function's catch handler, the error code -1, returned from the Win32 API
CreateFile(), means "unknown error".
I know this error message is of little help, anyway the problem is that the
system cannot create the file as specified by the path
Application.LocalUserAppDataPath + "config.config", mostly due to an
incorrect sequence of IO operations on the file or the path as result of a
virus scanner activity.
Willy.
JR - 09 May 2007 19:12 GMT
I think you are missing the backslash, and suggest you use Path.Combine.
JR
"Willy Denoyette [MVP]" <willy.denoyette@telenet.be> ???
??????:CA509099-E51E-4DF9-AA6F-F7FC7DD5926C@microsoft.com...
>> On "some client's computer" the folowing C# code:
>> ==
[quoted text clipped - 57 lines]
>
> Willy.
Willy Denoyette [MVP] - 09 May 2007 20:48 GMT
>I think you are missing the backslash, and suggest you use Path.Combine.
>
> JR
You are right, the path is messed up, however, the missing backslash is not
the cause of the Exception, at least not on my system.
Don't know what the OP is using as OS, but it's sure worth a try after
correcting this using Path.Combine.
Willy.
Lloyd Dupont - 10 May 2007 00:03 GMT
I was using Path.Combine in the real code anyway!

Signature
Regards,
Lloyd Dupont
NovaMind Software
Mind Mapping at its best
www.nova-mind.com
>>I think you are missing the backslash, and suggest you use Path.Combine.
>>
[quoted text clipped - 5 lines]
> correcting this using Path.Combine.
> Willy.
JR - 10 May 2007 04:45 GMT
What else is different in the real code?
JR
"Lloyd Dupont" <net.galador@ld> ???
??????:uj%23zA5okHHA.4852@TK2MSFTNGP03.phx.gbl...
>I was using Path.Combine in the real code anyway!
>
[quoted text clipped - 7 lines]
>> correcting this using Path.Combine.
>> Willy.
Lloyd Dupont - 10 May 2007 06:07 GMT
nothing much.
but every one focuse about the missing "\\" whereas wether or nor I forgot
it, it changes nothing to the error..... :-(

Signature
Regards,
Lloyd Dupont
NovaMind Software
Mind Mapping at its best
www.nova-mind.com
> What else is different in the real code?
>
[quoted text clipped - 13 lines]
>>> correcting this using Path.Combine.
>>> Willy.