.Net 4.0 Windows Application crashes in clr.dll under Windows Server 2008
I'm having the same issue. At approximately 8-10 hours of application life CLR error rises. I suspected my unmanaged code generating exception in the background thread. However I could not really find out why. You can give the following a try however:
- If you are using unmanaged code review exception handling statementswhile executig it.
- Make sure you have the latest fixes of .NET4.
(https://connect.microsoft.com/VisualStudio/Downloads)
Please let me know if you have already found a solution.
The hot-fix has mostly vanished and I faced a similar issue, so I'll share my answer here.
My solution revolved around the fact that I was passing a Lamda to a P/Invoke: