Questions tagged [contextswitchdeadlock]

22 questions
17
votes
1 answer

.NET - ContextSwitchDeadlock was detected

i have a class in c# (.net 3.5 cp, vs2010) which executes complex comuptations which ussually take a long time. After a minute there is thrown an exception, that ContextSwitchDeadlock was detected. Exception is localised, to my non english language…
user1018711
4
votes
1 answer

TcpClient Exception Deadlock

I have a curious behaviour in some code I inherited - simplified example below which demonstrates the issue if built into a plain Console App. WhoIs hits its usage allowance on the 5th call - and returns a message + shuts the socket. Using…
3
votes
1 answer

C# httpClient (block for async call) deadlock

Current Situation There is a client that does a get-request by HttpClient.GetAsync. Unfortunately, for some reason, we need to block on that calls. In order to do so, this Asynchelper class is used in order to avoid context-switch deadlocks (instead…
DanielG
  • 1,115
  • 1
  • 12
  • 32
3
votes
5 answers

contextswitchdeadlock

Whilst debugging my program in VS 2008 I have come across the following error: The CLR has been unable to transition from COM context 0x34fc1a0 to COM context 0x34fc258 for 60 seconds. The thread that owns the destination context/apartment is most…
NeedOfHelp
3
votes
0 answers

ComboBox takes way too long to open (COMException Error)

Here is the situation of my problem: I have a ListBox with two items of type MyClass. MyClass has a List collection. Somewhere else in the same window I have a ComboBox with the columns of the selected MyClass.ColumnCollection as…
Mixxiphoid
  • 1,044
  • 6
  • 26
  • 46
2
votes
0 answers

Context switch deadlock detected

I'm trying to use an Excel file like a database. I've written this code to open my Excel document that I'll use to work Private Sub Importa_XLS(ByVal fileData As String, ByVal dbVuoto As String, ByVal dbDest As String) Dim bw As…
Matteo
  • 205
  • 7
  • 16
2
votes
2 answers

Why does the Send-Email Program Freeze?

I made a small program in which I can basically send an email through the yahoo smtp server. My Code: using System; using System.Data; using System.Configuration; using System.Web; using System.Net; using System.Net.Mail; using System.Drawing; using…
user519653
2
votes
1 answer

What would cause/how can I prevent a ContextSwitchDeadlock?

I have a rather long-running process in a Windows Service that periodically throws a "ContextSwitchDeadlock" exception: I have also rigged my service to send myself emails with details about encountered exceptions. I get: Date: 05/25/2016…
2
votes
2 answers

Cooperative/Non-preemptive threading avoiding deadlocks?

Any creative ideas to avoid deadlocks on a yield or sleep with cooperative/non-preemptive multitasking without doing an O/S Thread.Sleep(10)? Typically the yield or sleep call will call back into the scheduler to run other tasks. But this can…
Wayne
  • 2,903
  • 2
  • 27
  • 46
1
vote
1 answer

Visual Studio 2008 ContextSwitchDeadlock with log4net and NHibernate

I'm facing an extremely weird bug here and I'm not really sure If I'm following the right path to solving it or even how to solve it. Here is the problem I'm facing: I start debugging a WPF application which uses log4net, NHibernate and LINQ to…
Jorge Vargas
  • 1,035
  • 12
  • 24
1
vote
0 answers

ContextSwitchDeadlock on XNA (MonoGame) form built as class library

I'm using runtime dll initialization through Assembly.LoadFile to load additional viewports for my project. I've succesfully launched WPF form and CS-SDL form (both built as dll's) that way, but MonoGame form is giving me an error after 60 sec. of…
Anatoly Sazanov
  • 1,500
  • 1
  • 11
  • 23
0
votes
1 answer

0x80010100: System call failed" exception, ContextSwitchDeadlock

Long story short: in a C# application that works with COM inproc-server (dll), I encounter "0x80010100: System call failed" exception, and in debug mode also ContextSwitchDeadlock exception. Now more in details: 1) C# app initializes STA, creates a…
Igor R.
  • 13,922
  • 1
  • 42
  • 74
0
votes
0 answers

Is there any way to resolve issue in which two simultaneous call to two different classes waiting for each other

I have two different classes in my project which are responsible for some opening and execution of modules and are called from some other solution. My solution doesn't support multi threading. Now my problem is -- I have one class CPMModule.cs …
Ravi
  • 1
  • 1
0
votes
1 answer

detect ContextDeadlockSwitch at runtime

A C# code retrieves a property value from a C++ dll and this retrieval blocks the current thread until the dll returns the value. In debug mode, when the retrieval takes a long time, the MDA throws a ContextDeadlockSwitch. I suppose it's not…
sjlewis
  • 716
  • 1
  • 11
  • 24
0
votes
1 answer

WPF: Integration into WinForms Error - "The CLR has been unable to transition from COM context 0x1a8188 to COM context 0x1a8018 for 60 seconds"

The full error I get is as follows: The CLR has been unable to transition from COM context 0x1a8188 to COM context 0x1a8018 for 60 seconds. The thread that owns the destination context/apartment is most likely either doing a non pumping wait or…
Hasanain
  • 905
  • 8
  • 16
1
2