Q:

AccessViolationException after upgrade to .Net 4.0

I upgrade a wpf desktop application from .net 3.5 to .net 4.0.(Changed the target framework to 4.0). After the upgrade it shows some unexpected behaviours. 
There is a tab control in the application. when i click a particular tab only either one of the following behaviours occurs.
1. Application crashed
2. AccessViolationException "Attempted to read or write protected memory. This is often an indication that other memory is corrupt."
3. Application closed
4. Sometimes working fine.  
Other than this tab control issue, application closed unexpectedly. (when closing a tab or scroll a window). Sometiems Fatalexecutionengine exception also thrown.
Everything worked fine before converted to .Net 4.0.
I don't have any clue what's happening there. Please help to resolve this.

A:

did you try to manually delete all the assemblies then rebuild everything with the new framework ? Visual Studio is often like windows, it needs to redo everything lol

