Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6722469
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T09:27:03+00:00 2026-05-26T09:27:03+00:00

What does this mean and how to resolve it? I am using TPL tasks.

  • 0

What does this mean and how to resolve it?

I am using TPL tasks.

The whole error

A Task’s exception(s) were not observed either by Waiting on the Task or accessing its Exception property. As a result, the unobserved exception was rethrown by the finalizer thread.

at System.Threading.Tasks.TaskExceptionHolder.Finalize()

mscorlib

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T09:27:04+00:00Added an answer on May 26, 2026 at 9:27 am

    If you create a Task, and you don’t ever call task.Wait() or try to retrieve the result of a Task<T>, when the task is collected by the garbage collector, it will tear down your application during finalization. For details, see MSDN’s page on Exception Handling in the TPL.

    The best option here is to “handle” the exception. This can be done via a continuation – you can attach a continuation to the task, and log/swallow/etc the exception that occurs. This provides a clean way to log task exceptions, and can be written as a simple extension method, ie:

    public static void LogExceptions(this Task task)
    {
        task.ContinueWith( t =>
        {
             var aggException = t.Exception.Flatten();
             foreach(var exception in aggException.InnerExceptions)
                 LogException(exception);
        }, 
        TaskContinuationOptions.OnlyOnFaulted);
    }
    

    With the above, you can prevent any task from tearing down the app, and logging it, via:

    Task.Factory.StartNew( () => 
       { 
           // Do your work...
       }).LogExceptions();
    

    Alternatively, you can subscribe to the TaskScheduler.UnobservedTaskException and handle it there.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Exception Thrown: System.ComponentModel.ReflectPropertyDescriptor is not marked as Serializable Does this mean I missed marking
HI, what does this mean, and how to resolve it? error RC2175 : resource
What does this mean and why am I getting this error. Any suggestions on
What does this mean? * Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*
What does this mean exactly? I'm doing something like this: File.Copy(@\\foo\bar\baz.txt, @c:\test\baz.txt); MSDN doesn't
What does this mean: Next add reference to: MySql.Data actually I have downloaded mysql
does anybody have any idea what's does this mean: onLoad=MyOnLoad? thanks
Can somebody tell me what does this mean? I'm going trough Java book and
Strange program hang, what does this mean in debug? After attaching windbg I found
For software applications like games, does this mean software companies have a lot of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.