question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

dotnet new error in SDK 2.0.3

See original GitHub issue

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.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
seancpeterscommented, Nov 20, 2017

@neman - thanks for bringing this to our attention. The failure of your template in 2.0.3 is a regression. It’s ok to explicitly define a “name” symbol in a template, it’s just a special case. I’ve made PR #1351 to fix this in the 2.1.0-preview1 branch of this repo.

0reactions
nemancommented, Dec 13, 2017

@SummerSun I guess that we have to wait for .NET Core 2.1.0 release. You can check here https://github.com/dotnet/templating/releases the last version release date.

Read more comments on GitHub >

github_iconTop Results From Across the Web

NETSDK1045: The current .NET SDK does not support ...
This error occurs when the build tools can't find the version of the .NET SDK that's needed to build a project. This is...
Read more >
The SDK 'Microsoft.NET.Sdk' specified could not be found. ...
Since Visual Studio 2022 updated from version 17.4 to 17.5, I couldn't load my project. and get the error "The SDK 'Microsoft.NET.
Read more >
The current .NET SDK does not support targeting . ...
NET Core 1.x preview SDKs, my application would not compile and showed the error. It was fixed by installing the latest x86 version...
Read more >
NET SDK error list - .NET CLI
This is a complete list of the errors that you might get from the .NET SDK while developing .NET apps. If more info...
Read more >
NET SDK does not support targeting .NET Core 2.0
net core SDK 2.1.2. When I open a new web application I get an error saying "the sdk 'microsoft.net.sdk.web' ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found