I receive the following error when debugging, but not when running the release version of my .NET 2.0 program:

"Attempted to read or write protected memory. This is often an indication that other memory is corrupt"

It's quite bizarre! I dont really know what else would be needed, but I can provide DLL versions etc if someone asks. Ive posted this in Ora/MTS forum because it only seems to happen when using a transaction on the client side

We have the exact same problem, only it's also in the release version. It definitly has something to do with transactions, the exception comes from oramts.

After the machine is started, it comes when the fist access through Oracle provider is made. Then it never appears until the machine is rebooted again.

We have worked around this problem by triggering the problem on purpose, and swallows it, when the applications starts. Not very pretty, but better than having the customer getting an exception for the first data access made.

Ensure that the oramts.dll is up to date. Oracle released a debug version with one of their packages and many systems have this version. It causes the error.

Even when you updated the dll, ensure you do a CLEAN of your .NET project before your rebuild it. Every time I forget to clean before I rebuild, i get this error, in release or debug mode. CLEAN removes all old/half compiled .NET objects.

Make sure that Distributed Transaction Coordinator (MS DTC) service Startup is set to start automatically.

I had the same problem and this was exactly the cause. My machine, which I reboot every day, did not start this process automatically. So always on the first try I would get that error, and then I wouldn't see it again until the next day. Our prod box never gets reset so it has never occurred there.

Has anyone seen this message occur without any ORA- error associated with it?

Every 10-15 hours we're getting the error "System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt." but no ORA error stack accompanying it.

In this case, would it be a .Net error as opposed to an ODP/ODAC error?

Hi I have similar issue. Like others, it seems that the error returned by oracle make ASP.NET (w3wp.exe) to have runtime error.
In my case, it occurs about once every day, consistently. The ASP still work even after runtime error but start to take up high cpu usage after 2nd and 3rd time of error, and totally crash (no reponse to the client request) after 3 or 4 times of errors. It recovers back after the server is restarted.

maybe i can offer solution for your w3wp.exe service, did you ready set up an Default Application Pool on IIS ? if you not ready setup your default application pool, i think you will be got a problem about w3wp, cause in application pool you can setup for your memory, process even in crash, the service will be automatic restart w3wp service.