コードを投稿しますが、ポイントが表示されません。ブレークポイントを配置すると、コードに到達せず、実行が到達する前にエラーがトリガーされるためです。最初は、.config ファイルで重複している可能性があると考えていましたが、見たことがありません。コードは正しくコンパイルされます。
ありがとう。
これが私が得るエラーです:
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)
編集: エラーは NDESK に関連していました。同じ変数を 2 回使用していました。
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 },
}