An unhandled exception of type 'System.StackOverflowExceoption' occurred in mscorlib.dll [Cannot evaluate expression because the current thread is in stack overflow state] using C#


I had a strange problem this morning. I complied a project and ran it with no problems at all. This project generated Access 2010 file and saved it. Everything was fine until I tried to load that Access file within my project. This is when I received following error

An unhandled exception of type 'System.StackOverflowExceoption' occurred in mscorlib.dll

Detailed:
Cannot evaluate expression because the current thread is in stack overflow state

Project was working fine last night when i closed it. No one changes anything then how can it produce errors automatically!

I Googled the errors and tried many solutions but nothing was working for me. I re-referenced the DLLs but no.

I left everything and start thinking ...... Anything I missed... !!!

and I realized that I missed one step

Run as Administrator

I did not run Visual Studio 2010 with "Run as Administrator" which was causing problem in my scenario. It is very small bit which you can ignore easily but it worked for me.



While searching answer over the internet i came across following articles which were good to read

http://we-help-all.com

http://stackoverflow.com/questions/17283299/stackoverflowexception-was-unhandled-an-unhandled-exception-of-type-system-sta

http://stackoverflow.com/questions/19367234/an-unhandled-exception-of-type-system-formatexception-occurred-in-mscorlib-dll

http://stackoverflow.com/questions/18378170/cannot-evaluate-expression-error



This is not a definitive solution for everyone but this is the one which worked for me and I thought to share it with community. It always good to try small things but only if the project was working fine before and suddenly came up with errors.


Hope it will help someone.







Comments

Popular posts from this blog

RDLC / RDL report - How to determine last row in Tablix/Table

GOOGLE privacy policy New Rule 1 March 2012 (How to turn the settings off to stop sharing your personal information)

Specializing Your Skills: Postgraduate Studies to Enhance Career Prospects