Closed LokiMidgard closed 3 years ago
I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.
Maybe it's because it had already been installed, you can try to install some other templates to see if it works, for example:
dotnet new -i Xunit.DependencyInjection.Template
@WeihanLi Today I'm on a different PC, but the PC where I have problems was setup recently and I'm as sure as I can be that I did not installed one of the templates I tested (before). Also if the templates would already be installed I should see them in the list and could create projects using new.
I just installed the uno templates on my current machine and it worked without problems.
But I can try to install Xunit when I get back to the problematic PC.
Hi @LokiMidgard, I'm guessing maybe it's because the template you tried(Microsoft.DotNet.Web.Spa.ProjectTemplates
) may already be included in the .NET SDK.
Glad to hear you installed other templates successfully.
@WeihanLi I could install on a different machine. On the problematic machine I was not able to install any (tested 2) templates. I will test more when I'm back (tomorrow or next week)
I tried to install Xunit.DependecyInjection.Template and it also does not work.
The output of dotnet --info
dotnet --info
.NET SDK (gemäß "global.json"):
Version: 5.0.301
Commit: ef17233f86
Laufzeitumgebung:
OS Name: Windows
OS Version: 10.0.19042
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\5.0.301\
Host (useful for support):
Version: 5.0.7
Commit: 556582d964
.NET SDKs installed:
3.1.412 [C:\Program Files\dotnet\sdk]
5.0.301 [C:\Program Files\dotnet\sdk]
.NET runtimes installed:
Microsoft.AspNetCore.App 3.1.18 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 5.0.7 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 3.1.18 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 5.0.7 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 3.1.18 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 5.0.7 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
To install additional .NET runtimes or SDKs:
https://aka.ms/dotnet-download
@LokiMidgard
Likely in case above the installation failed, however dotnet new
has poor logging for install in 5.0, so the error is not shown.
We improved the install UX in .NET 6 (preview 4), if it works for you could you please install the latest .NET 6 preview and try again?
As for troubleshooting for 5.0.301, I may suggest to start with trying to perform dotnet restore
manually as described here and see if it works.
If you can afford losing all previously installed templates for dotnet new, removing C:\Users\<username>\.templateengine\dotnetcli\5.0.301
folder content may also help (if settings got corrupted) but it will remove all previously installed templates.
@vlada-shubina
I have already installed .net 6 preview 6.0.100-preview.7.21379.14
. I tried to install the template again and it worked now...
I don't know how to use the .net 5 version to install the template and I would prefre to not delete it, so I can't give you better information over error.
@LokiMidgard you can use global.json to specify SDK version to use. As the problem is solved, I'm closing the issue, please let me know in case of any further problems.
I tried to install the UNO project template using
dotnet new -i Uno.ProjectTemplates.Dotnet
but nothing is installed. The Output:I also tried
dotnet new -i Microsoft.DotNet.Web.Spa.ProjectTemplates
as shown in the docs but this also did not work.dotnet --version
shows5.0.301
I'm not sure if that is related but I also installed
3.1.4.12
today. But I can't say if it worked before.