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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T23:38:20+00:00 2026-06-15T23:38:20+00:00

I would post my code, but I don’t see the point, since if I

  • 0

I would post my code, but I don’t see the point, since if I put a breakpoint in it, it never reaches it, the error is triggered before the execution reaches it. I initially thought it could have been a duplicate in the .config file, but I haven’t seen any. The code compiles properly.

Thanks.

Here is the error I get:

Unhandled Exception: System.ArgumentException: An item with the same key has alr
eady been added.
   at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
   at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boo
lean add)
   at System.Collections.ObjectModel.KeyedCollection`2.AddKey(TKey key, TItem it
em)
   at System.Collections.ObjectModel.KeyedCollection`2.InsertItem(Int32 index, T
Item item)
   at NDesk.Options.OptionSet.InsertItem(Int32 index, Option item)
   at System.Collections.ObjectModel.Collection`1.Add(T item)
   at NDesk.Options.OptionSet.Add(String prototype, String description, Action`1
 action)
   at manifest_mass_deployment.Program.Main(String[] args)

Edit: The error was related to NDESK, I was using the same variable twice:

var p = new OptionSet(){
  { "t|time=", "start time", v=> starttime = v },
  { "s|span=", "span time", v=> spantime = v },
  { "t|thread=", "Fhreads to fork", v=> threads = v },
}
  • 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-15T23:38:20+00:00Added an answer on June 15, 2026 at 11:38 pm

    The problem arises with NDesk. If this is the callback-based program option parser for C# found here, maybe it does something before your code runs? Maybe it tries to parse command line options?

    At least, the message is clear: NDesk is trying to add a key to a dictionary which already exists. If this is nothing in your code, it must be some automatic mechanism that for example reads a file and builds a dictionary from it.

    From what I see, NDesk should help you parse command line options – the problem may be that you’re passing in the same parameter twice?

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

Sidebar

Related Questions

Can someone post an example of as3 code (specifically event listener included) that would
I thought I would post this here not so much as a question but
I'm working on homework and I won't post the full code but I'm stuck
Everybody's seen this before, but what is this code? I don't even know what
The well-cited RIP Hash rocket post would seem to imply the Hash Rocket syntax
From this post : I would first suggest that you optimize your dependentObservable (a.k.a.
I would like to POST an entity as follows POST /example.org/MyEntity/100 Based on the
I would like to POST data from my Windows Phone to a webpage that
I'm developing a PHP game and would like to post players highscores to their
This post identifies a feature that I would like to disable. Current numpy behavior:

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.