Unexpected Internal Software Issue (EX_SOFTWARE) An item with the same key has already been added. Key: -p:R
See original GitHub issueUpdated VS, and got dotnet version 7.0.100. Now my (unchanged) template fails, with stacktrace below. Cannot trace the -p:R to any parameters passed to dotnet new.
An item with the same key has already been added. Key: -p:R
at System.Collections.Generic.Dictionary2.TryInsert(TKey key, TValue value, InsertionBehavior behavior) at System.Collections.Generic.Dictionary
2.Add(TKey key, TValue value)
at System.CommandLine.Parsing.StringExtensions.ValidTokens(Command command)
at System.CommandLine.Parsing.StringExtensions.Tokenize(IReadOnlyList1 args, CommandLineConfiguration configuration, Boolean inferRootCommand) at System.CommandLine.Parsing.Parser.Parse(IReadOnlyList
1 arguments, String rawInput)
at Microsoft.TemplateEngine.Cli.Commands.InstantiateCommand.ReparseForTemplate(InstantiateCommandArgs args, IEngineEnvironmentSettings environmentSettings, TemplatePackageManager templatePackageManager, TemplateGroup templateGroup, CliTemplateInfo template, Boolean validateDefaultLanguage)
at Microsoft.TemplateEngine.Cli.Commands.InstantiateCommand.ReparseForTemplate(InstantiateCommandArgs args, IEngineEnvironmentSettings environmentSettings, TemplatePackageManager templatePackageManager, TemplateGroup templateGroup, IEnumerable1 templatesToReparse, Boolean& languageOptionSpecified) at Microsoft.TemplateEngine.Cli.Commands.InstantiateCommand.GetTemplateCommand(InstantiateCommandArgs args, IEngineEnvironmentSettings environmentSettings, TemplatePackageManager templatePackageManager, TemplateGroup templateGroup) at Microsoft.TemplateEngine.Cli.Commands.InstantiateCommand.HandleTemplateInstantationAsync(InstantiateCommandArgs args, IEngineEnvironmentSettings environmentSettings, TemplatePackageManager templatePackageManager, TemplateGroup templateGroup, CancellationToken cancellationToken) at Microsoft.TemplateEngine.Cli.Commands.InstantiateCommand.ExecuteIntAsync(InstantiateCommandArgs instantiateArgs, IEngineEnvironmentSettings environmentSettings, TemplatePackageManager templatePackageManager, InvocationContext context) at Microsoft.TemplateEngine.Cli.Commands.BaseCommand
1.InvokeAsync(InvocationContext context)
For details on the exit code, refer to https://aka.ms/templating-exit-codes#70
Issue Analytics
- State:
- Created 10 months ago
- Comments:6 (3 by maintainers)
Top GitHub Comments
Minimal repro:
template.json
:@mkonijnenburg, @satyajit-behera - thank you for reporting this issue and appology for the inconvenience caused. Issue is currently understood, fix is about to be submitted and it will be considered for the next servicing release.
In the meantime (before next servicing release) you have 2 options how to workaround this issue:
template.json
- Rename the symbols in a way so that there are no more than 3 symbols with the same prefixdotnetcli.host.json
Adddotnetcli.host.json
next to yourtemplate.json
file and specify custom short aliases for your symbols, or turn them off alltogether. Sampledotnetcli.host.json
for the minimal repro above:Thanks for the info and tip about the default value. I hope the fix will arrive shortly.