I am developing a C# application in Visual Studio 2008 that uses folder browser dialog and printdialog. Lately the program is encountering an error whenever ShowDialog() Method for these two dialog boxes is called.
The error says:
Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
The strange thing is that this error is specific to this project only. When I use folder browser dialog in a new C# project it works perfectly fine. Moreover this error started occurring recently in the mentioned project. Earlier it used to work perfectly fine. Also, this error does not occur when I run the program from the IDE in debugging mode.
There is a suggestion in some other question on Stack Overflow to uncheck "Suppress JIT optimization on module load" in debugging options. I have tried that too but that did not solve my problem.
Can someone please help me solve this problem?
[c#]alone; one of them might help. - Ken White