Aspnetcore: Blazor 0.8.0 standalone project that was generated by "dotnet new blazor" command could not launch.

Created on 6 Feb 2019  ·  3Comments  ·  Source: dotnet/aspnetcore

Describe the bug

Blazor 0.8.0 standalone project that was generated by dotnet new blazor command could not launch.

To Reproduce

Steps to reproduce the behavior:

  1. Install .NET Core SDK ver.3.0.0-preview-19075-0444 from here.
  2. Install Visual Studio 2019 Preview 2.
  3. Install Blazor 0.8.0 template by dotnet new -i Microsoft.AspNetCore.Blazor.Templates::0.8.0-preview-19104-04
  4. Create Blazor 0.8.0 standalone project by dotnet new blazor.
  5. Restore and build it by dotnet build. (this will be success.)
  6. Run it by dotnet run
  7. The error message (see bellow) is shown, and it could not launch.
The specified framework 'Microsoft.AspNetCore.App', version '3.0.0-preview-19104-06' was not found.

Expected behavior

dotnet run launch blazor server successfully.

Screenshots

image

Additional context

The hosted version of Blazor 0.8.0 that was generated by dotnet new blazorhosted CLI works fine.

I could not find the version 3.0.0-preview-19104-06 of .NET Core SDK or Runtime in my internet searching.

My workaround

I rewrited "%HOME%.nuget\packages\microsoft.aspnetcore.blazor.cli\0.8.0-preview-19104-06\lib\netcoreapp3.0\dotnet-blazor.runtimeconfig.json" to use v.19075-0444 instead of v.19104-06.

image

After that, "dotnet run" works fine.

area-mvc question

All 3 comments

Additional Information

The Blazor standalone project that was generated by Visual Studio 2019 Preview 2.x worked fine.

The difference of theses projects was bellow:

<!-- from "dotnet new blazor"-->
<DotNetCliToolReference Include="Microsoft.AspNetCore.Blazor.Cli" Version="0.8.0-preview-19104-06" />

```xml

I tried uninstall the project template with `dotnet new -u Microsoft.AspNetCore.Blazor.Templates -Version` command, and reinstall it with `dotnet new -i Microsoft.AspNetCore.Blazor.Templates::0.8.0-preview-19104-04` command.

After that, `dotnet new blazor` generate the csproj as bellow:

```xml
<!-- from "dotnet new blazor" after reinstall project template -->
<DotNetCliToolReference Include="Microsoft.AspNetCore.Blazor.Cli" Version="0.8.0-preview-19104-04" />

Of course, Version 0.8.0-preview-19104-04 CLI works fine.

I'm not sure about why my first installation of Blazor project template for dotnet CLI was configured for using invalid version"19104-06".

Thanks for contacting us, @jsakamoto.
Glad you've found the cause of this and managed to fix it.
@danroth27, what this could be caused by?

@jsakamoto I suspect when you installed the Blazor templates initially you somehow picked up a version of the templates package from one of our MyGet feeds with dev builds.

Since you've resolved your own issue I'm going to go ahead and close this.

Was this page helpful?
0 / 5 - 0 ratings