2
votes

I'm trying to "get started" with Blazorfollowing Microsoft's guidelines,

I've installed the .NET Core 3.0 Preview SDK as indicated, but then I try to run the command

dotnet new -i Microsoft.AspNetCore.Blazor.Templates::3.0.0-preview5-19227-01

respectively from terminal and powershell both as admin and not, getting this error:

Did you mean to run dotnet SDK commands? Please install dotnet SDK from:...

I proceeded anyway installing Visual Studio Preview (with Blazor Extension)

to be able to run the command form the Visual studio terminal, but I'm simply getting this error:

Command "dotnet" is not valid.

Looks like doesn't recognize the installed SDK (3.0 or previous),

enter image description here

any idea how can I solve the issue? thanks in advance

1
Have you restarted since the install of the SDK? And have you checked that dotnet is in your system path? Though I suppose it may not need to be in the path if you're using the Visual Studio terminal. - Dillanm
I've restarted several times and in the environment variables I have not 1, not 2, but 3! dotnet: "c:\Program Files(x86)\dotnet\", "c:\Program Files\dotnet\" and "c:\Program Files\dotnet". I've added manually one of the last 2 I don't remember which one. [edit: problem still persist] - Francesco Iapicca
I imagine if you've got multiple of the same executable in your path then it can't resolve which one you're trying to call - try manually using the full path to the .NET Core 3.0 SDK dotnet.exe in a command line e.g. "c:\Program Files\dotnet\dotnet.exe" new -i Microsoft.AspNetCore.Blazor.Templates::3.0.0-preview5-19227-01 (you can use dotnet --version to find the version of the exe if you're unsure which is which) - Dillanm
@Dillanm it worked! you are awesome, thanks mate if you post it as an answer I'll accept it straight away - Francesco Iapicca
No worries, glad I could help :) - Dillanm

1 Answers

1
votes

I imagine if you've got multiple of the same executable in your path then it can't resolve which one you're trying to call.

Try manually using the full path to the .NET Core 3.0 SDK dotnet.exe in a command line e.g. "C:\Program Files\dotnet\dotnet.exe" new -i Microsoft.AspNetCore.Blazor.Templates::3.0.0-preview5-19227-01 (you can use dotnet --version to find the version of the exe if you're unsure which is which)