Can you encounter memory violation using an array? An AccessViolationException exception is always thrown by an attempt to access protected memory - that is, to access memory that is not allocated or that is not owned by a process. Make sure that the memory that you are attempting to access has been allocated. How do I resolve AccessViolationException?
1 How do I resolve AccessViolationException?.