Reputation: 3947
Ive got a C# 2.0 app that launches the Crystal Reports viewer and displays some reports. If I run this in Debug or Release mode OUTSIDE of visual studio, it runs fine. If I debug this through Visual Studio 2005, the report will pop up, but then a minute or two later VS freaks out on a ContextSwitchDeadlock, also telling me that no symbols have been loaded for any call stack frame so i can't debug it.
This likely has something to do with the fact the report is being launched on another thread. The reasons for this are a little convoluted but I'll try to explain in case it's important:
We have a long-running process that runs on a background thread. When the process is done it launches reports. If it(the background thread) just calls Show(non-modal) on the report viewer forms, it will then terminate and kill all those report forms immediately. So instead it launches one child thread per report and calls it with ShowDialog(modal). That way the forms are all seemingly non-modal to each other, but when the user closes the LAST one, the background process thread now has no child threads and it can terminate.
Does this makes sense, and does anyone have any idea why I'd be getting the ContextSwitchDeadlock MDA inside VS, but no exception is thrown when the code runs standalone?
Upvotes: 1
Views: 5161
Reputation: 1491
I am using visual studio 2022 and my problem is gone while I installing the missing font.
Upvotes: 0
Reputation: 1
Got the same problem. It's been known to cause database Expert to cause VS to crash also due to some xml file being in your c:\temp directory. First option is, to empty the c:\temp directory (worked for me). Second you can try to rename your temp directory to "MyTemp" or something similiar. And last but not least you can try setting your project to use 4.0 Framework not the client version.
P.S:@John Cruz Nope he didnt, I don't work with separate threads in my project and got the same ContextSwitchDeadlock-Error.
Upvotes: 0
Reputation: 1494
Delete or move any .xml files in your c:/temp folder if you have one. They cause database expert to crash VS
Upvotes: 0
Reputation: 908
Try renamining you c:\temp\ directory - There is a know issues that if there is an XML file in the c:\temp\ Crystal Reports Crashes and you cant open them..
Upvotes: 1
Reputation: 1592
I think you answered your own question... it has to do with how your running it in a separate thread.
Upvotes: 0