Hi can any one know how to resolve 'System.InvalidOperationException' : in windows application.
This exception is coming only when i debug it but when I run my application from MyApp.exe then no Exception it is working fine
Please help
thanks in advance
Loading

srinivasPosted Jul 26, 2010, 8:52 AM
I found some other solution which is related to my issue and that is
If your app is not multithreaded, the problem could be caused by the Visual Studio hosting process. The Visual Studio hosting process starts up a main thread and then creates a new UI thread that the application is run on. In some circumstances this can lead to a cross-thread exception, for example when accessing Form.ActiveForm before calling Application.Run.
If this is your problem, you can uncheck "Enable the Visual Studio hosting process" in the Debug tab of Project Properties.
but still iam getting same execption after making the above settings
Mamta MPosted Jul 26, 2010, 6:28 AM
catch(Exception ex)
{
Console.WriteLine(ex.StackTrace);
}
That will help you detect the line number and the line of code causing the error.