Comments (13)
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.
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.
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.
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.
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
from elmah.
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.
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.
> 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.
Fixed in r237.
Original comment by azizatif
on 5 Nov 2007 at 5:12
- Changed state: Fixed
from elmah.
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.
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.
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.
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)
- Migrate to Automatic Package Restore HOT 9
- Elmah doesn't display LOGON_USER HOT 1
- The SQL Server Compact package references an obsolete SQL Server Compact package HOT 4
- clustered index on ELMAH_Error
- <i class=" onmouseover="alert(document.domain)//""> HOT 1
- why i can not receive some mail from elmah in elmah.axd HOT 1
- Sign the assemblies HOT 1
- Building fails when using Command Prompt for VS 2013 HOT 2
- Razor templates broken by more recent Razor Generator versions HOT 2
- nugetRestore.proj warning about non-existing project HOT 5
- VS build on fresh clone breaks demo web site HOT 1
- VS build on fresh clone breaks demo web site HOT 6
- Multiple log sources
- Patch for /src/Elmah.SqlServer/SQLServer.sql
- Fix build issues with the demo project HOT 2
- Build fails without Internet connectivity HOT 3
- Cannot set ApplicationName for XmlFileErrorLog HOT 2
- Internal Server Error error code 500 is logged as 0
- Move repo/project off Google Code HOT 2
- Can we configure Elmah email setting at runtime HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from elmah.