Click here to Skip to main content
15,886,199 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi guys!
this exception is appearing in every debug try!
CSS
System.AccessViolationException was unhandled
Message: An unhandled exception of type 'System.AccessViolationException' occurred in mscorlib.dll
Additional information: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
Posted
Comments
[no name] 8-Jul-15 21:23pm    
Debug your code, find the problem with your code, fix the problem.
polaniavera 17-Mar-17 8:55am    
Hi, this execption happened to me when I try retrieve entities from SQL Server with lazy loading entity framework 5, because the objects make a loop, so I disabled the lazy load on DBContext custom constructor:

public MyEntitiesContext() : base("name=MyEntitiesContext", "MyEntitiesContext")
{
this.ContextOptions.LazyLoadingEnabled = false;
}

I hope this result usseful.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900