Closed GoogleCodeExporter closed 9 years ago
I just want to clarify, the grid itself is simply trying to write some data to
a
file, and the file is read only which is why it is not working. However, the
part
that is bothering me is that Elmah is throwing an exception and not able to log
the
error. Above is the details. Thank you
Original comment by abdullah...@gmail.com
on 5 Nov 2007 at 1:16
Original comment by azizatif
on 5 Nov 2007 at 1:28
I think all that is needed is to clean/sanitize the data before logging it, but
I am
not sure exactly what function to call to do that. It's hard to reproduce this
error unless you are using this specific grid.
Original comment by abdullah...@gmail.com
on 5 Nov 2007 at 1:30
This problem occurs because some detail of the exception cannot be persisted
since
the characters in range 0x00 to 0x1F (except 0x09, 0x0A and 0x0D) are not legal
in
XML 1.0.
Original comment by azizatif
on 5 Nov 2007 at 1:33
Yes, that's the only way. Actually the XmlWriter.WriteString documentation is
incorrect:
http://msdn2.microsoft.com/en-us/library/system.xml.xmlwriter.writestring.aspx
It states, "Character values in the range 0x-0x1F (excluding white space
characters
0x9, 0xA, and 0xD) are replaced with numeric character entities (� through
�x1F)." However, this does not happen by default. By default, it throws an
exception. There is a way in .NET 2.0 to disable the character checking by
setting
XmlWriterSettings.CheckCharacters to false, but this does not make it legal XML
1.0.
As a result sanitization may be the only right approach here.
Original comment by azizatif
on 5 Nov 2007 at 1:36
On second thoughts, it looks like that it may be best to resort to
XmlWriterSettings.CheckCharacters for now in order to remain compatible with
.NET
1.x builds as well as error objects that have already been formatted and
persisted
based on the current behavior.
Original comment by azizatif
on 5 Nov 2007 at 2:25
Are you saying Set CheckCharacters to false and check it in to the build?
Original comment by abdullah...@gmail.com
on 5 Nov 2007 at 3:40
> Are you saying Set CheckCharacters to false
> and check it in to the build?
Yes
Original comment by azizatif
on 5 Nov 2007 at 3:45
Fixed in r237.
Original comment by azizatif
on 5 Nov 2007 at 5:12
You beat me to it, I was just about to email you with the fix.
Original comment by abdullah...@gmail.com
on 5 Nov 2007 at 6:06
I'm running Elmah 1.1.11517.2009 and am receiving this error when pulling up
elmah.axd. The error itself is being logged as this error is appearing in
"ELMAH_Error" (in my SQL DB).
'', hexadecimal value 0x01, is an invalid character. Line 1, position 166.
If I manually hide some of the errors in ELMAH_Error (by changing the
Application), then elmah.axd works without error. The stacktrace shows that
the error is occurring in "Elmah.SqlErrorLog.ErrorsXmlToList()" -- looks like
on line 61 (sort of hard to tell as I'm reading the XML encoded error directly
in the DB).
I hid about 20 errors to get elmah.axd to work. Probably one of those errors
contains the offending character, but I'm not sure which one. I've been using
Elmah for this project for over a year without this problem. The error was
logged using Elmah, so I can only speculate a problem persists. Thanks.
Original comment by ben.am...@gmail.com
on 8 Jul 2011 at 3:30
Following up on my comment, I should say that I just upgraded this project from
ASP.NET 3.5 to ASP.NET 4.0 about 2 days ago. Maybe it's related to that?
Original comment by ben.am...@gmail.com
on 8 Jul 2011 at 3:31
Hi there!
Try upgrading to ELMAH v1.2
Cheers,
James
Original comment by jamesdriscoll71
on 8 Jul 2011 at 2:48
Original issue reported on code.google.com by
abdullah...@gmail.com
on 5 Nov 2007 at 1:13