I have just upgraded to dotnet 5 from 3.1 on my Linux machine and when I try to create a new console or any project I get the following error
dotnet new console
Value cannot be null. (Parameter 'path1')
at System.IO.Path.Combine(String path1, String path2, String path3, String path4)
at Microsoft.TemplateEngine.Utils.EngineEnvironmentSettings.DefaultPathInfo.get_BaseDir()
at Microsoft.TemplateEngine.Edge.Paths.UserPaths.get_AliasesFile()
at Microsoft.TemplateEngine.Edge.Settings.AliasRegistry.EnsureLoaded()
at Microsoft.TemplateEngine.Edge.Settings.AliasRegistry.TryExpandCommandAliases(IReadOnlyList`1 inputTokens, IReadOnlyList`1& expandedInputTokens)
at Microsoft.TemplateEngine.Cli.AliasSupport.TryExpandAliases(INewCommandInput commandInput, AliasRegistry aliasRegistry)
at Microsoft.TemplateEngine.Cli.AliasSupport.CoordinateAliasExpansion(INewCommandInput commandInput, AliasRegistry aliasRegistry, ITelemetryLogger telemetryLogger)
at Microsoft.TemplateEngine.Cli.New3Command.ExecuteAsync()
at Microsoft.TemplateEngine.Cli.CommandParsing.NewCommandInputCli.<>c__DisplayClass19_0.<<OnExecute>b__0>d.MoveNext()
This error appears almost at any command I try to run.
Extract from dotnet --info:
.NET SDK (reflecting any global.json):
Version: 5.0.100
Commit: 5044b93829
Runtime Environment:
OS Name: ubuntu
OS Version: 18.04
OS Platform: Linux
RID: ubuntu.18.04-x64
Base Path: /usr/share/dotnet/sdk/5.0.100/
Host (useful for support):
Version: 5.0.0
Commit: cf258a14b7
.NET SDKs installed:
3.1.301 [/usr/share/dotnet/sdk]
5.0.100 [/usr/share/dotnet/sdk]
.NET runtimes installed:
Microsoft.AspNetCore.App 3.1.5 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 5.0.0 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 3.1.5 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 5.0.0 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
To install additional .NET runtimes or SDKs:
https://aka.ms/dotnet-download
question from:
https://stackoverflow.com/questions/65858110/dotnet-set-up-in-vscode 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…