Microsoft.AspNet.WebApi.MessageHandlers.Compression
Microsoft.AspNet.WebApi.MessageHandlers.Compression copied to clipboard
AccessViolationException - Attempted to read or write protected memory
Hi,
I'm using Owin based WebApi project. After adding your middleware and making few successful requests getting following exception and application crashes: System.AccessViolationException was unhandled Message: An unhandled exception of type 'System.AccessViolationException' occurred in System.Web.dll Additional information: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
I tried both OwinServerCompressionHandler and ServerCompressionHandler handlers, with .Net 4.5 and after upgrading 4.6.1 with same result.
What I'm doing wrong ?
Thanks in advance, Mark
Hi and sorry for the late response. An AccessViolationException can occur outside of my classes, usually pushed up from unmanaged code. See https://msdn.microsoft.com/en-us/library/ms164911.aspx. Since my handler is the last in the request an unhandled exception might seem to be thrown there, but really comes from somewhere else.
But it can of course also be my code (although i've never encountered this error, across all my production code that uses it). Do you have a stack trace or something to go with the error message?
Same issue here! Installed it a few hours ago and this exception started popping out. I'm working on this backend since 2014 and it never happened, so I'm quite confident it should be related to Compression.
Unfortunately, those are all the details Visual Studio is giving about it:
System.AccessViolationException was unhandled Message: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.