Skip to main content

All Questions

0 votes
2 answers
360 views

Using async task to throw an exception after some time

I'm trying to create a forced timeout mechanism that runs asynchronously. Ideally I need to run a task, without waiting for it, and I expect that after some time it throws an exception to mimic a ...
user2962069's user avatar
1 vote
0 answers
99 views

until the window handle has been created Invoke or BeginInvoke cannot be called on a control

This is the exception i am getting while updating my UI in a non UI thread. Like I have few labels on a winform, and i want to update the data of labels from a thread. When i try to update i got this ...
Arslan Javed's user avatar
0 votes
1 answer
84 views

How to create one-to-one multithreading relationship and handling exception in C#

It's the first time that I work on multithreading application (in general, not only with C#), and for this reason I know only simple notions about it. I've realized basically implementation with ...
Gabriele Troviso's user avatar
3 votes
2 answers
180 views

Exception is lost while consuming a PLINQ query

I observed a weird behavior while experimenting with a PLINQ query. Here is the scenario: There is a source IEnumerable<int> sequence that contains the two items 1 and 2. A Parallel LINQ Select ...
Theodor Zoulias's user avatar
0 votes
0 answers
86 views

How to catch Control.invoke exception full stacktrace in other thread?

Consider the following: (1)Top-Catch void Test() { Task.Run(async() => { try { while(true) { string result = ...
Endless's user avatar
1 vote
0 answers
106 views

Safest way/practice to call c++ dll which can crash or stuck

Let's assume that I have some dll's. One can freeze indefinitely or run some UI methods of its own for too long. The other can crash with either simple or Corrupted State Exceptions. Is there some ...
binariti's user avatar
  • 103
1 vote
0 answers
53 views

C# InternetExplorer and Thread Throwing "System.NotSupportedException"

I am sure I had my SIP (solution in progress) working as it was supposed to, now it's not - perhaps a recent update to WebViewer has thrown a spanner in the works - (a bad workman blames his tools, a ...
Nunoya's user avatar
  • 11
0 votes
1 answer
692 views

How to make Visual studio break in on uncaught exception in thread?

In this sample code, when I call a(), the debugger breaks in properly, and I can inspect all local variables and stack frames. Now if I call b(), I get a completely useless "exception was thrown ...
user avatar
2 votes
1 answer
52 views

Catch exceptions in multi threads and processes program

I'm trying to catch some specific exception. The problem is that my program is complex and can hide this exception as a 'primary' exception or as an inner exception inside an aggregated exception. (it ...
Nika's user avatar
  • 57
0 votes
0 answers
146 views

Catch exceptions from abandoned task C#

I am working on an application that receives "jobs" to work on, and could only run 3 jobs in parallel (say 3 is a configurable number). Here's how the flow looks like: A job is received ...
MichaelEr's user avatar
0 votes
1 answer
201 views

MultiThread, ApartmentState.MTA point Exception : System.PlatformNotSupportedException: COM Interop is not supported on this platform

I am using multi-thread method while saving my email data to database with dapper. There was no problem in my local tests, but it gave an error when I published it on the server. See my method here, ...
Ahmet atasagun's user avatar
0 votes
1 answer
363 views

Restart Thread on Exception in C# [duplicate]

I have a normal C# thread that calls a third party API (which internally makes a Network API call), recently I observed that sometimes the third party API throws WebTimeOut exception. My thread which ...
Abhishek Dhar's user avatar
1 vote
1 answer
138 views

LockRecursionException in multiple threaded function

I dont know how to describe it but I'm getting exception that schouldn't have a place when a code is good written. This exception is about issue with ReaderWriterLockSlim and it's ...
SEGMK's user avatar
  • 156
1 vote
0 answers
35 views

Output currently executed code from a thread

In case of an exception you can find out the line where the exception occurred with : int line = (new StackTrace(ex, true)).GetFrame(0).GetFileLineNumber(); Analogous, I want to output the currently ...
Denis_'s user avatar
  • 11
0 votes
0 answers
171 views

Weird ThreadAbortException in custom IOptionsFactory<OpenIdConnectOptions> when debugging only?

My class is the following: public class OpenIdConnectOptionsFactory : IOptionsFactory<OpenIdConnectOptions> { private readonly IEnumerable<IConfigureOptions<OpenIdConnectOptions>>...
SpiritBob's user avatar
  • 2,722

15 30 50 per page
1
2 3 4 5
19