aspnetcore: Blazor: Default template doesn't run on newest version

Describe the bug

When I create a new blazor project using the most recent version it builds but it doesn’t run.

To Reproduce

  1. Install .NET Core SDK (3.0.100-preview4-011223)
  2. dotnet new -i Microsoft.AspNetCore.Blazor.Templates::3.0.0-preview4-19216-03
  3. dotnet new blazor
  4. dotnet build
  5. dotnet run

Error Message

> dotnet run
Could not execute because the specified command or file was not found.
Possible reasons for this include:
  * You misspelled a built-in dotnet command.
  * You intended to execute a .NET Core program, but dotnet-C:\Users\Ricardo does not exist.
  * You intended to run a global tool, but a dotnet-prefixed executable with this name could not be found on the PATH.

Additional context

> dotnet --info
.NET Core SDK (reflecting any global.json):
 Version:   3.0.100-preview4-011223
 Commit:    118dd862c8

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.17763
 OS Platform: Windows
 RID:         win10-x64
 Base Path:   C:\Program Files\dotnet\sdk\3.0.100-preview4-011223\

Host (useful for support):
  Version: 3.0.0-preview4-27615-11
  Commit:  ee54d4cbd2

.NET Core SDKs installed:
  2.1.504 [C:\Program Files\dotnet\sdk]
  2.1.602 [C:\Program Files\dotnet\sdk]
  2.2.105 [C:\Program Files\dotnet\sdk]
  3.0.100-preview4-011223 [C:\Program Files\dotnet\sdk]

.NET Core runtimes installed:
  Microsoft.AspNetCore.All 2.1.8 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.All 2.1.9 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.All 2.2.3 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.App 2.1.8 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 2.1.9 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 2.2.3 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 3.0.0-preview4-19216-03 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 2.1.8 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.1.9 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.2.3 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 3.0.0-preview4-27615-11 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.WindowsDesktop.App 3.0.0-preview4-27613-28 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 1
  • Comments: 17 (4 by maintainers)

Commits related to this issue

Most upvoted comments

I fixed my version by replacing the file C:\Users\USER_NAME\.nuget\packages\microsoft.aspnetcore.blazor.devserver\3.0.0-preview4-19216-03\build\Microsoft.AspNetCore.Blazor.DevServer.props with the one from the fix

Thanks @rjmr97 for reporting this. Thanks @pranavkm and @JunTaoLuo for fixing it!

Fixed in https://github.com/aspnet/AspNetCore/pull/9659

@danroth27 I created a new account with no spaces (rribeiro) and it worked.

D:\>mkdir test4 && cd test4

D:\test4>dotnet new blazor
The template "Blazor (client-side)" was created successfully.

Processing post-creation actions...
Running 'dotnet restore' on D:\test4\test4.csproj...
  Restore completed in 3,14 sec for D:\test4\test4.csproj.

Restore succeeded.


D:\test4>dotnet run
Hosting environment: Production
Content root path: D:\test4
Now listening on: http://localhost:5000
Now listening on: https://localhost:5001
Application started. Press Ctrl+C to shut down.

@ramimod Can you open a new issue so I (or others) can try to help you? I don’t think your problem is related to mine so there’s no reason to use this thread