Skip to content

dotnet new error in SDK 2.0.3 #1349

@neman

Description

@neman

I have a working template which is used in production environment and is regularly updated.
It works fine with .NET Core SDK version 2.0.0 and version 2.0.2.

I installed SDK 2.0.3 as I wanted to test my existing template.
Installation of the template went fine as seen on this image
image
When I tried dotnet new -h I got the following message

Value cannot be null.                                                                                                                                                                                                                          
Parameter name: key                                                                                                                                                                                                                            
   at System.ThrowHelper.ThrowArgumentNullException(ExceptionArgument argument)                                                                                                                                                                
   at System.Collections.Generic.Dictionary`2.FindEntry(TKey key)                                                                                                                                                                              
   at System.Collections.Generic.Dictionary`2.TryGetValue(TKey key, TValue& value)                                                                                                                                                             
   at Microsoft.TemplateEngine.Orchestrator.RunnableProjects.SimpleConfigModel.Evaluate(IParameterSet parameters, IVariableCollection rootVariableCollection, IFileSystemInfo configFile)                                                      
   at Microsoft.TemplateEngine.Orchestrator.RunnableProjects.RunnableProjectGenerator.GetCreationEffects(IEngineEnvironmentSettings environmentSettings, ITemplate templateData, IParameterSet parameters, IComponentManager componentManager, 
String targetDirectory)                                                                                                                                                                                                                        
   at Microsoft.TemplateEngine.Cli.New3Command.CheckIfTemplateHasScriptRunningPostActions(ITemplate template)                                                                                                                                  
   at Microsoft.TemplateEngine.Cli.New3Command.GetTemplateUsageInformation(ITemplateInfo templateInfo, IParameterSet& allParams, IReadOnlyList`1& userParamsWithInvalidValues, IReadOnlyDictionary`2& variantsForCanonicals, HashSet`1& userPar
amsWithDefaultValues, Boolean& hasPostActionScriptRunner)                                                                                                                                                                                      
   at Microsoft.TemplateEngine.Cli.New3Command.ShowTemplateGroupHelp(IList`1 templateGroup, Boolean showImplicitlyHiddenParams)                                                                                                                
   at Microsoft.TemplateEngine.Cli.New3Command.DisplayTemplateHelpForSingularGroup()                                                                                                                                                           
   at Microsoft.TemplateEngine.Cli.New3Command.<EnterSingularTemplateManipulationFlowAsync>d__57.MoveNext()                                                                                                                                    
--- End of stack trace from previous location where exception was thrown ---                                                                                                                                                                   
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()                                                                                                                                                                           
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)                                                                                                                                           
   at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult()                                                                                                                                              
   at Microsoft.TemplateEngine.Cli.New3Command.<EnterTemplateManipulationFlowAsync>d__58.MoveNext()                                                                                                                                            
--- End of stack trace from previous location where exception was thrown ---                                                                                                                                                                   
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()                                                                                                                                                                           
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)                                                                                                                                           
   at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult()                                                                                                                                              
   at Microsoft.TemplateEngine.Cli.New3Command.<ExecuteAsync>d__59.MoveNext()                                                                                                                                                                  
--- End of stack trace from previous location where exception was thrown ---                                                                                                                                                                   
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()                                                                                                                                                                           
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)                                                                                                                                           
   at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult()                                                                                                                                              
   at Microsoft.TemplateEngine.Cli.CommandParsing.NewCommandInputCli.<>c__DisplayClass19_0.<<OnExecute>b__0>d.MoveNext()                                                                                                                       

image

When I tried to create new template with command dotnet new bibapi -n test123 I got following error:

Template "BIB Rest API" could not be created.
Value cannot be null.
Parameter name: key

image

The same template is working fine when I change SDK to 2.0.0 or 2.0.2 using global.json in folder where I'm creating templates.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions