|
-
July 31st, 2008, 03:41 AM
#1
C# - APP: Exception: The operation was canceled.
Hi all,
i need help with one exception. I know only .Message of this exception and i know which part of code throws it.
Message:
.Message: "The operation was canceled."
Code:
Code:
try
{
FileIOPermission perm = new FileIOPermission(FileIOPermissionAccess.Write, file_name);
perm.Assert();
if (!additive && File.Exists(file_name)) File.Delete(file_name);
using(FileStream fs = new FileStream(file_name, FileMode.OpenOrCreate, FileAccess.ReadWrite))
{
using(StreamWriter writer = new StreamWriter(fs))
{
writer.BaseStream.Seek(0, SeekOrigin.End);
writer.Write(content);
writer.Flush();
writer.Close();
result = true;
}
fs.Close();
}
CodeAccessPermission.RevertAssert();
}
catch (System.Exception err)
{
System.Diagnostics.Debug.WriteLine(err.Message);
throw(err);
}
FYI: This Windows application runs for many years, but once this error was occured and stored in log. Can somebody help me? Is anythere List of exception messages, where I can find what does the exception mean?
Last edited by cjard; July 31st, 2008 at 12:03 PM.
-
July 31st, 2008, 08:26 AM
#2
Re: C# - APP: Exception: The operation was canceled.
change this line:
Code:
System.Diagnostics.Debug.WriteLine(err.Message);
to
Code:
System.Diagnostics.Debug.WriteLine(err.ToString());
you will also get the stack trace when writing the entire error.
-
July 31st, 2008, 12:04 PM
#3
Re: C# - APP: Exception: The operation was canceled.
 Originally Posted by strakamichal
This Windows application runs for many years, but once this error was occured and stored in log.
It ran for years and you care that this error happened once? Wow.. Not much to do at your work eh?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|