Aspnetcore: Getting started demo shows blank page

Created on 20 Apr 2018  路  13Comments  路  Source: dotnet/aspnetcore

I have been following the getting started article, but when I run it, all I get is a blank page. I see the "Loading..." notice, then it goes away, but nothing else shows up.

I have tried in IE, Edge, Firefox, Chrome etc. I have made sure I don't have any blocking like uBlock. When I look at the network traffic in developer tools, everything is downloading fine. I have tried running with, and without debugger. I have checked event logs, but don't see anything related. I have also tried the core hosted version.

Also note, that I installed all the items from the article this morning, so I have all the latest bits.

Is there some way I can debug the issue or something else I should try?

area-blazor

Most helpful comment

dotnet --version shows 2.1.500-preview1-008174

OK, that's the issue. You need to have the latest .NET Core 2.1 Preview SDK installed (2.1.300-preview2-008533), and it needs to be the active SDK.

If you're certain that you installed this version of the SDK already, then you need to see if you have a global.json somewhere up your folder hierarchy that is pinning the SDK version to an older version.

I'm going to go ahead and close this issue, but if you end up still having problems please reopen and let us know.

All 13 comments

I'm sorry you're having difficulty getting Blazor up and running!

Could you please check the console in the browser dev tools to see if any errors are showing up there?

Also, just to double check you have the right versions of everything:

  • Could you share the output of dotnet --version when run from the project folder?
  • Could you please share the contents of the project file for your Blazor app?
  • Could you please confirm that the Blazor packages are being correctly restored from nuget.org? Ex check the package manager output in VS and also try running dotnet restore from your project folder
  • Have you run any previous versions of Blazor? If yes, could you please clear out your browser cache?

There are no errors on the console of the dev tools.
dotnet --version shows 2.1.500-preview1-008174
dotnet restore completed without any issue
This is my first try with Blazor, I have not run any previous version.
Project file is below.

<Project Sdk="Microsoft.NET.Sdk.Web">

  <PropertyGroup>
    <TargetFramework>netstandard2.0</TargetFramework>
    <RunCommand>dotnet</RunCommand>
    <RunArguments>blazor serve</RunArguments>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="Microsoft.AspNetCore.Razor.Design" Version="2.1.0-preview2-final" PrivateAssets="all" />
    <PackageReference Include="Microsoft.AspNetCore.Blazor.Browser" Version="0.2.1" />
    <PackageReference Include="Microsoft.AspNetCore.Blazor.Build" Version="0.2.1" />
    <DotNetCliToolReference Include="Microsoft.AspNetCore.Blazor.Cli" Version="0.2.1" />
  </ItemGroup>

</Project>

dotnet --version shows 2.1.500-preview1-008174

OK, that's the issue. You need to have the latest .NET Core 2.1 Preview SDK installed (2.1.300-preview2-008533), and it needs to be the active SDK.

If you're certain that you installed this version of the SDK already, then you need to see if you have a global.json somewhere up your folder hierarchy that is pinning the SDK version to an older version.

I'm going to go ahead and close this issue, but if you end up still having problems please reopen and let us know.

I'm guessing you actually have 2.1.300-preview1-008174 installed (2.1.500-preview1-008174 doesn't exist), which was the Preview1 version. You need Preview2.

You are correct on both counts, I miss typed the "3" as a "5", and I only had preview 1 installed not 2. The crazy thing is, I can't figure out how. I never had installed any previews prior to this morning, and I simply clicked on the links in the article to the required items. I did read a few articles on blazor this morning but I don't think I click to install anything until I got the "Get Started" article on blazor.net. Oh well in any case I goofed somewhere along the way, and it is working fine now. Thank you!

By the way, very cool project, I am excited.

Glad you got it working!

I had the exact same issue. I'm guessing you also used learn-blazor.com @mattfraley1? That's what I used, and I've found that it links to preview 1.

Thank you for your help @danroth27, it works just fine now.

Ahhh, that was probably it. I did spend some time on that site. Thank you, I thought I lost my mind or something.

I ran into this issue using the "latest Visual Studio" Azure template and solved it by installing the specific version 2.1.300-preview1-008174. Incidentally, along the way I also found the 2.1.4 SDK download seems to be available, so I tried that but it didn't work.

2.1.4 is older than the 2.1.300 preview2

https://blogs.msdn.microsoft.com/webdev/2018/03/22/get-started-building-net-web-apps-in-the-browser-with-blazor/

This page says that preview1 should work - but it doesn't. Please fis this.

That is an old blogpost for blazor 0.1. So technically it is correct.

@michidk You can find the latest Blazor getting started instructions on https://blazor.net

Was this page helpful?
0 / 5 - 0 ratings