Skip to main content
Filter by
Sorted by
Tagged with
1 vote
2 answers
149 views

I have a problem with AggregateException thrown from .NET library. For some reason it is not caught in try-catch block. It causes whole application to crash and there are no methods from my code in ...
Maciejosas's user avatar
0 votes
2 answers
164 views

I am trying to implement a windows service by using worker project with communication to a SQL Server database. ON running it, I am getting two exceptions : System.AggregateException: Some services ...
Anas Nabi's user avatar
2 votes
1 answer
195 views

I have a custom exception class derived from AggregateException. It's shown below. As you can see, one of the things I do is build a custom Message, where I truncate the inner exceptions to keep it ...
Bassinator's user avatar
  • 1,734
1 vote
1 answer
935 views

I would like to catch all Task's exceptions of a batch of task, but I don't find the best solution. Maybe anyone can help me please? I have a function with the following declaration: public async Task ...
Adrien Ruffie's user avatar
0 votes
1 answer
1k views

private void AccountValidations(CreateAccountPayload payload) { if (string.IsNullOrEmpty(payload.Note)) { throw new ArgumentException($ "Note cannot be empty"); } if (string....
mohan's user avatar
  • 1
0 votes
1 answer
196 views

I am looking into a memory problem and found this is the log today: System.AggregateException: One or more errors occurred. ---> System.ArgumentException: Exception of type 'System....
Halvard's user avatar
  • 4,001
2 votes
1 answer
1k views

I have the following custom exception : public class MyCustomException : Exception { public MyCustomException(string message) : base(message) { } } I throw it at this point: ...
DaveVentura's user avatar
0 votes
0 answers
533 views

I'm querying a third-party SDK with a fully async-await method and SDK returns an AggregateException in a normal scenario. In AggregateException inner exception will be a type of ABCException. But ...
manish bhalodiya's user avatar
1 vote
0 answers
73 views

I am trying to publish a self-contained executable for Windows. When I try to run the executable via a privileged powershell (or cmd) window, I get the following error: Unhandled exception. System....
PikachuBoss33's user avatar
0 votes
1 answer
315 views

I am creating several FirestoreChangeListeners (following the User Guide at https://googleapis.github.io/google-cloud-dotnet/docs/Google.Cloud.Firestore/userguide.html) and everything is working fine, ...
Damian's user avatar
  • 119
3 votes
1 answer
1k views

When causing multiple exceptions in a Task.WhenAll call, it looks like only one of the exceptions is absorbed into the Task once you await it through more than one layer of awaiting. I was under the ...
John's user avatar
  • 748
0 votes
0 answers
149 views

I'm following on with a tutorial detailing handling events thrown in multiple subscribers to an event. However when the code is run, the TargetInvocationException catch block isn't catching the ...
James's user avatar
  • 356
0 votes
2 answers
272 views

I am trying to check the TCP connection to a localhost TCP server using following code: string host = "localhost"; int port = 61616; using (TcpClient tcpClient = new TcpClient()) { try ...
Sayan Sen's user avatar
  • 1,824
1 vote
1 answer
399 views

I spent hours racking my head as to why this isn't working I'm trying to use ScrapySharp to scrape websites, right now just trying out sample sites then moving to my actual site. Every time I do a ...
arcanium0611's user avatar
4 votes
1 answer
1k views

I am probably missing a very obvious fact, but I have a hard time understanding the need for AggregatedExceptions. I know since async/await we don't have to bother with AggregatedExceptions anymore (...
bas's user avatar
  • 15.2k
1 vote
2 answers
6k views

I have a question about when its safe to handle an aggregate exception when using WhenAll(). It seems like the natural place would be inside the catch block, because if the catch block never fires, it ...
broadbear's user avatar
  • 684
0 votes
0 answers
73 views

I'm working on a backup manager for some Quest (critical infrastructure monitoring devices) when running the Code it seems to be running my tasks as its adding them to a task list before calling ....
Brett Jackson's user avatar
1 vote
3 answers
2k views

I got an async method working like an enhanced Task.WhenAll. It takes a bunch of tasks and returns when all are completed. public async Task MyWhenAll(Task[] tasks) { ... await Something(); ...
adrianm's user avatar
  • 14.8k
0 votes
1 answer
2k views

I would like to use the http client class to call an api controller method and the PostAsync method has thrown an Aggregate Exception. I tried to write an async method what call the PostAsync and try ...
Bence Balyi's user avatar
0 votes
0 answers
2k views

I am using parallel.foreach in my code to submit multiple url for my application. Initially it work fine but after few day I noticed this exception occurs often. I googled it for many hours but no ...
Khurram Shaikh's user avatar
3 votes
1 answer
2k views

I have the following code which is firing off a number of async Task. List<TimeoutException> TimeoutExceptions = new List<TimeoutException>(); List<...
neildt's user avatar
  • 5,403
1 vote
2 answers
646 views

In C++17, what is the proper pattern/approach to handling a collection of multiple exceptions? Is there a C++ equivalent to C# AggregateException Class? (I'm aware that exception as flow control is ...
Eugene's user avatar
  • 11.6k
3 votes
0 answers
161 views

The code below causes a code analysis warning CA2000, claiming that I need to dispose of getRequest along all code paths before it goes out of scope. Tweaking the code slightly, for example removing ...
Rob's user avatar
  • 4,537
1 vote
1 answer
2k views

Created a simple program using Linqpad, where I am throwing an exception explicitly in the Parallel Foreach loop, which ideally shall be caught in the caller as Aggregate Exception, but when I ...
Mrinal Kamboj's user avatar
2 votes
1 answer
3k views

Let's say I have an Interface: interface A { string Do(); } and then I implement this interface in a class. The implementation requires some async operations. Something like the following: class ...
alfoks's user avatar
  • 4,664
1 vote
1 answer
409 views

I am trying to catch an AggregateException from a Task.Run() operation which intentionally fails, however an AggregateException is not thrown. Why? public void EnterWaitingRoom(string val) { try ...
Herb Ramos's user avatar
1 vote
1 answer
1k views

I want a task to finish when the 50 Milliseconds are over. The status of the task should then be set to "Cancelled", otherwise to "RunToCompletion". The task creation is here: ...
Laurence's user avatar
3 votes
2 answers
1k views

I'm trying to catch an NullReferenceException which is going to be thrown by Task.Factory.StartNew method. I think it should be caught by 'try' statement with task.Wait() method. I also referred to ...
Bicycle-riding Dog's user avatar
1 vote
1 answer
235 views

I'm experiencing really strange behavior, which I cannot neither understand nor explain. I was able to create a really simple sample to demonstrate that. That was reproduced on VS.Net 2013 & 2015 ...
Lanorkin's user avatar
  • 7,574
1 vote
2 answers
8k views

I have a problem. I try to run multiple long running tasks. If one fails I wanna cancel all other tasks and get the failure exception. The example given below. I wanna catch AggregateException with ...
Gintaras's user avatar
2 votes
1 answer
2k views

I'm working on a cross platform library that makes HTTP requests. It's working fine on Android, but when I try to use it on iOS I'm getting an exception and I can't figure out how to fix it. Here is ...
Jared Price's user avatar
  • 5,433
2 votes
0 answers
264 views

I've been battling this issue for sometimes. A windows service targeting .NET 4.0 creates a .NET signalr client but gets killed after sometimes for System.Threading.Tasks.TaskExceptionHolder.Finalize()...
Stack Undefined's user avatar
0 votes
1 answer
32 views

I want to report about Exceptions that are thrown during execution of some tasks: //waiting for all the tasks to complete try { Task.WaitAll(task1, task2, task3); } catch (AggregateException ex) {...
gene's user avatar
  • 2,098
1 vote
1 answer
237 views

I am working with Github API via Octokit.net. Now I am writing code that responsible for TwoFactorAuth. When I send request for token, if it is 2FA account, than I must get "TwoFactorRequiredException"...
Yura Babiy's user avatar
-1 votes
1 answer
869 views

HttpResponseMessage response = client.GetAsync("api/MOB_Vw_UsersAPI/GetMOB_Vw_Users?Uname=" + uname + "&Pass=" + pass).Result; When I run this part of code on Windows Phone emulator ...
FSD's user avatar
  • 485
0 votes
0 answers
388 views

I got the problem in my pet-project. Totally I wanna counting the files in some directory filtering them by some options (length). It works good for me when "reading" of files or directories occured ...
user avatar
0 votes
0 answers
45 views

I am wanting to sequentially send POST() data to a website. I want post1 to finish, then begin post2, then begin post3 etc etc. I have syntax that compiles, but I get an error of that I am unsure ...
MasterOfStupidQuestions's user avatar
-3 votes
1 answer
14k views

I have followed the tutorial in ( http://www.c-sharpcorner.com/UploadFile/a6fd36/understand-self-host-of-a-web-apiC-Sharp/ ) and ( http://www.c-sharpcorner.com/uploadfile/a6fd36/understanding-how-to-...
Wahm's user avatar
  • 13
7 votes
1 answer
2k views

I get complete set of nested exceptions when I use ToString() method on AggregateException directly: public void GreenTest() { var ex = new AggregateException(new Exception("ex1"), new Exception("...
Buthrakaur's user avatar
  • 1,851
3 votes
0 answers
378 views

so i'm trying to use parse.com in my unity project, it was all working fine until i added a new column in my user database. It throw exception every time i tried to access my currentUser. In the ...
libra's user avatar
  • 683
0 votes
0 answers
634 views

I am trying out Couchbase database, I've followed the tutorial here: http://developer.couchbase.com/documentation/server/4.0/sdks/dotnet-2.2/hello-couchbase.html I've installed the nugget from ...
Pavel Durov's user avatar
  • 1,297
3 votes
1 answer
679 views

I am using PLINQ with code below: static void Main(string[] args) { var lt = new List<int>() {1,2,3,4,5}; try { var nlt = lt.AsParallel().Select(Test)....
Sean's user avatar
  • 981
1 vote
1 answer
3k views

I have some code that makes an asynchronous http call like so: try { var myHttpClient = new HttpClient(); var uri = "http://myendpoint.com"; HttpResponseMessage response = client.GetAsync(uri)....
jkj2000's user avatar
  • 1,603
2 votes
1 answer
2k views

I have a problem with handling the AggregateException if my WinForms application starts a task to keep responsive while the task is performing. The simplified case is as follows. Suppose my Form has ...
Harald Coppoolse's user avatar
9 votes
1 answer
12k views

I have this code as below to capture the exceptions throw from tasks created by using TaskFactory and Task.Run. If I use the TaskFactory, I am able to check the Exception thrown from the previous task ...
Helic's user avatar
  • 949
3 votes
2 answers
2k views

Working with Entity Framework 7, I made a simple mistake with some linq (used Skip and forgot to include my OrderBy clause). The exception that was thrown by this included a number of nested ...
Jon Egerton's user avatar
  • 41.8k
4 votes
1 answer
2k views

The documentation on MSDN for the AggregateException.Flatten method says the following: "If any inner exceptions are themselves instances of AggregateException, this method will recursively flatten ...
Matthew Rodatus's user avatar
1 vote
0 answers
2k views

I am getting an error trying to move a DataSourceResult from one web service to another... the client calls web service A which resides on our web server. We then make a call to web service B which ...
flagman's user avatar
  • 29
1 vote
2 answers
3k views

HttpClient async methods (e.g. PostAsync, GetAsync etc.), if an exception is thrown, returns an AggregateException. Now an aggregate exception can contain a list of inner exceptions. My question is ...
Mayoweezy's user avatar
  • 587
4 votes
1 answer
2k views

How can I mark an exception thrown in a task as handled. The problem is when I call the Wait() method of a task, it will throw an AggregateException even when I have already handled the ...
Stefan Vettiger's user avatar