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 9087487
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T21:42:24+00:00 2026-06-16T21:42:24+00:00

I get the below exception when I try to add/insert/remove to a collection (or

  • 0

I get the below exception when I try to add/insert/remove to a collection (or any operation that changes the collection).
The collection is initialized and the item inserted is not null and of the same type as the collection T.

Can any one give me a clue as to why this happens?

The runtime has encountered a fatal error. The address of the error was at 0x60f41744, on thread 0x231c. The error code is 0x80131623.
This error may be a bug in the CLR or in the unsafe or non-verifiable portions of user code. Common sources of this bug include user marshaling errors for COM-interop or PInvoke, which may corrupt the stack.

Update:
The collection is an ObservableCollection, and I managed to get down to know that it happens on the notify part of the collection changed.

This happens on the UI thread inside a task with the TaskScheduler.FromCurrentSynchronizationContext() option.

The weird thing is if I remove this (TaskScheduler.FromCurrentSynchronizationContext()) option the add/insert/remove action, all seems to work good.

  • 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-06-16T21:42:25+00:00Added an answer on June 16, 2026 at 9:42 pm

    The error code is 0x80131623

    That’s a very specific error code, COR_E_FAILFAST. Only one way to generate it, somebody called Environment.FailFast().

    Clearly the challenge is to find out what code called that. First look in the Windows Application event log, there ought to be a message about it that gives the primary reason for the call, whatever string was passed to FailFast().


    The application requested process termination through System.Environment.FailFast(string message).
    at System.Environment.FailFast(System.String)
    at System.Windows.WeakEventManager.DeliverEventToList(System.Object, System.EventArgs, ListenerList)
    at System.Windows.WeakEventManager.DeliverEvent(System.Object, System.EventArgs)

    Yes, there’s an Assert() in that code. I’ll just post what I can see in the Reference Source, I don’t know enough about your code to see what you did wrong. Other than that threading is certainly a good way to get this kind of problem triggered, ObservableCollection is entirely thread-unsafe and must be protected by a lock.

       // if the event isn't handled, something is seriously wrong.  This
       // means a listener registered to receive the event, but refused to
       // handle it when it was delivered.  Such a listener is coded incorrectly.
       if (!handled)
       {
           Invariant.Assert(handled,
                       SR.Get(SRID.ListenerDidNotHandleEvent),
                       SR.Get(SRID.ListenerDidNotHandleEventDetail, iwel.GetType(), managerType));
       }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I only try to add domain but get connection refused exception: The command line
Help. I get the exception below when I try to run my service. I
I get an exception (see below) if I try to do resultset.getString(add_date); for a
I get ArgumentOutOfRange exception when I try to add nodes into a treeview using
I got the below Exception when i wnat to get the data from another
When I run the following code, I get the exception below: ''# NOTE: ExcelApp
This is my code below. The program runs fine. I don't get any exceptions.
I'm trying to get the below cURL operation to login on a bangme.net picture
I have a website that I get the below error on whenever I navigate
I get the error below when I try to execute a task with celery

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.