Giter Site home page Giter Site logo

Comments (13)

GoogleCodeExporter avatar GoogleCodeExporter commented on August 18, 2024
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 [email protected] on 5 Nov 2007 at 1:16

from elmah.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 18, 2024

Original comment by azizatif on 5 Nov 2007 at 1:28

  • Changed state: Accepted
  • Added labels: Component-Persistence, Priority-High
  • Removed labels: Priority-Medium

from elmah.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 18, 2024
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 [email protected] on 5 Nov 2007 at 1:30

from elmah.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 18, 2024
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

from elmah.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 18, 2024
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 
&#0x1F)." 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

from elmah.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 18, 2024
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

  • Changed title: Logging fails when error contains invalid characters for XML 1.0
  • Changed state: Started

from elmah.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 18, 2024
Are you saying Set CheckCharacters to false and check it in to the build?

Original comment by [email protected] on 5 Nov 2007 at 3:40

from elmah.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 18, 2024
> 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

from elmah.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 18, 2024
Fixed in r237.

Original comment by azizatif on 5 Nov 2007 at 5:12

  • Changed state: Fixed

from elmah.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 18, 2024
You beat me to it, I was just about to email you with the fix.

Original comment by [email protected] on 5 Nov 2007 at 6:06

from elmah.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 18, 2024
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 [email protected] on 8 Jul 2011 at 3:30

from elmah.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 18, 2024
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 [email protected] on 8 Jul 2011 at 3:31

from elmah.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 18, 2024
Hi there!

Try upgrading to ELMAH v1.2

Cheers,

James

Original comment by jamesdriscoll71 on 8 Jul 2011 at 2:48

from elmah.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.