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

  • Home
  • SEARCH
  • 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 8154223
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T16:16:11+00:00 2026-06-06T16:16:11+00:00

I am getting this exception: Collection was modified; enumeration operation may not execute. Directly

  • 0

I am getting this exception:

Collection was modified; enumeration operation may not execute.

Directly after this code:

     else if (count == 0)
                    {
                        partCategory.Add(words[count].ToString());
                        foreach (string categoryS in partCategory)
                        {
                            if (categoryS != words[count].ToString())
                            {
                                partCategory.Add(words[count].ToString());
                            }
                        }
                    }

I am taking a guess that it may be the Add method that was used prior to it, but I’m not sure.

Call Stack Code:

**********.exe!**********m.FileController.readSortText(string fileName = "**********extracted\\PC120701.txt", System.Windows.Forms.ProgressBar newProgress = {Value = 0 Min = 0 Max = 100}) Line 78 + 0x207 bytes   C#

**********.exe!**********.mainForm.unzipFile(string fileName = "**********") Line 133 + 0x42 bytes  C#
**********.exe!**********.mainForm.decompress_Click(object sender = {Text = "Unzip"}, System.EventArgs e = {X = 49 Y = 7 Button = Left}) Line 163 + 0x17 bytes  C#

[External Code] 
**********.exe!**********.Program.Main() Line 18 + 0x28 bytes   C#

[External Code] 

Thanks for your future help!

  • 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-06T16:16:14+00:00Added an answer on June 6, 2026 at 4:16 pm

    Yes that’s because you are modifying the collection you are enumerating.

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

Sidebar

Related Questions

I am getting this exception: Collection was modified; enumeration operation may not execute. when
I am getting: collection was modified enumeration operation may not execute at this lline:
Possible Duplicate: Getting exception as “Collection was mutated while being enumerated” This question is
I am getting Following Exception while configuring the Connection Pool in Tomcat This is
I am getting this exception when trying to run my PHP unit tests: Fatal
Hello everyone I am getting this exception: The magic number in GZip header is
I am getting this exception while running any JSP on my tomcat5.5 server.Do I
I am getting this exception while accessing the jax-ws web service from my client.
Hey guys I am getting this exception when trying to run the query Column
I am getting this Exception application openwnn (process jp.co.omronsoft.openwnn) has stopped in the emulator

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.