Access Violation in C# class library
-
We've just started seeing a System.AccessViolation exception ocurring in our ASP.NET website, which we're struggling to get our heads around - anyone have any ideas? The situation is that we have a page which makes a call to the database through a C# class library. This call is "succeeding" in that I'm seeing it being issued under SqlProfiler, and running the query returns the results I'd expect to see. The next database call appears not to be happening. The next call takes data from the return of the first call, so we thought it could potentially be a ADO.NET issue, but looking at the call stack, it appears that it's occurring in a function that we aren't actually calling. The call stack indicates that the exception is ocurring in our Encrypt function - this function uses DESCryptoServiceProvider to encrypt data. It's used in many places in our app, but we're only seeing the exception in one place. Additionally, as mentioned, the Encrypt function is not being called according to the code, but it is according to the stack trace... To add a little more confusion, we're only seeing this on one of our servers (which happens to be remotely hosted) - all in house servers (both dev and standard boxes) are just fine. Anyone?
C# has already designed away most of the tedium of C++.
-
We've just started seeing a System.AccessViolation exception ocurring in our ASP.NET website, which we're struggling to get our heads around - anyone have any ideas? The situation is that we have a page which makes a call to the database through a C# class library. This call is "succeeding" in that I'm seeing it being issued under SqlProfiler, and running the query returns the results I'd expect to see. The next database call appears not to be happening. The next call takes data from the return of the first call, so we thought it could potentially be a ADO.NET issue, but looking at the call stack, it appears that it's occurring in a function that we aren't actually calling. The call stack indicates that the exception is ocurring in our Encrypt function - this function uses DESCryptoServiceProvider to encrypt data. It's used in many places in our app, but we're only seeing the exception in one place. Additionally, as mentioned, the Encrypt function is not being called according to the code, but it is according to the stack trace... To add a little more confusion, we're only seeing this on one of our servers (which happens to be remotely hosted) - all in house servers (both dev and standard boxes) are just fine. Anyone?
C# has already designed away most of the tedium of C++.
that sounds to me like your one server is running an older, maybe even an inconsistent, set of files. How about you remove everything and reinstall the site on that server? :)
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
-
that sounds to me like your one server is running an older, maybe even an inconsistent, set of files. How about you remove everything and reinstall the site on that server? :)
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
Thanks for the reply Luc. Starting to think that may be the solution, but it does seem to be a rather large sledgehammer to crack a pretty small nut lol! Particularly when considering the fact that all of the other sites on the same server use the same source code (albeit in differently versioned dlls) and are all just hunky dory Having already unregistered and reregistered asp.net, a reinstall of the site would probably be the next logical step, with a reinstall of the framework if that doesn't fix it. Many thanks
C# has already designed away most of the tedium of C++.
-
Thanks for the reply Luc. Starting to think that may be the solution, but it does seem to be a rather large sledgehammer to crack a pretty small nut lol! Particularly when considering the fact that all of the other sites on the same server use the same source code (albeit in differently versioned dlls) and are all just hunky dory Having already unregistered and reregistered asp.net, a reinstall of the site would probably be the next logical step, with a reinstall of the framework if that doesn't fix it. Many thanks
C# has already designed away most of the tedium of C++.
You're welcome. You aren't trying to mix .NET versions on a single IIS, are you? as that is not supposed to work AFAIK. :)
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
-
You're welcome. You aren't trying to mix .NET versions on a single IIS, are you? as that is not supposed to work AFAIK. :)
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
OK - now that's something we DIDN'T know....though we do have that situation on many of our other servers.....wondering now if you're actually correct and it's not SUPPOSED to work, we've just been lucky in that it has, but now we're seeing the problem. Again, many thanks chap.
C# has already designed away most of the tedium of C++.
-
We've just started seeing a System.AccessViolation exception ocurring in our ASP.NET website, which we're struggling to get our heads around - anyone have any ideas? The situation is that we have a page which makes a call to the database through a C# class library. This call is "succeeding" in that I'm seeing it being issued under SqlProfiler, and running the query returns the results I'd expect to see. The next database call appears not to be happening. The next call takes data from the return of the first call, so we thought it could potentially be a ADO.NET issue, but looking at the call stack, it appears that it's occurring in a function that we aren't actually calling. The call stack indicates that the exception is ocurring in our Encrypt function - this function uses DESCryptoServiceProvider to encrypt data. It's used in many places in our app, but we're only seeing the exception in one place. Additionally, as mentioned, the Encrypt function is not being called according to the code, but it is according to the stack trace... To add a little more confusion, we're only seeing this on one of our servers (which happens to be remotely hosted) - all in house servers (both dev and standard boxes) are just fine. Anyone?
C# has already designed away most of the tedium of C++.
It can be that you have encoded your connection string and while the user account has sufficient permissions to decode it on your own servers, it doesn't has so on the production servers.