VS2005 C++ Unit Tests – System.AccessViolationException: Attempted to read or write protected memory.
System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt..
If you have VS2005 C++ Unit Tests, written in managed C++ as they should be, and you are calling native code from them, and you see that error when running your unit tests – I have found it to mean that you are using insecure versions of methods (strcpy, etc). If you change the method calls to the secure versions, you should see your tests pass!
