System.AccessViolationException is added newly in .NET 2.0. In 1.1, we may get NullReferenceException when we try to call COM method[when there is an attempt to read or write protected memory]. This exception is replaced by System.AccessViolationException in .NET 2.0. We can make it to behave as 1.1/1.0 after migration by adding below tag to config under <runtime>
<legacyNullReferenceExceptionPolicy enabled = "1"/>
System.AccessViolationException in .NET Migration
This tip will help us to resolve exception coming after .NET Migration(from 1.1 to >2.0),when calling Unmanaged/Unsafe managed code


Join the conversation! Your thoughts help the community grow.