Error when using Github actions to publish and host blazor webassembly

Viewed 24

I am using this tutorial to publish my Blazor WebAssemply site to Github pages. When I run the action I get

/home/runner/work/learning-blazor/learning-blazor/Learning_Blazor.csproj : error MSB4236: The SDK 'Microsoft.NET.Sdk.BlazorWebAssembly' specified could not be found.

All other tutorials lead to the same result. Here is my main.yml:

name: Deploy to GitHub Pages

# Run workflow on every push to the master branch
on:
  push:
    branches: [ main ]

jobs:
  deploy-to-github-pages:
    # use ubuntu-latest image to run steps on
    runs-on: ubuntu-latest
    steps:
     # uses GitHub's checkout action to checkout code form the master branch
    - uses: actions/checkout@v2.4.2
    
    # sets up .NET Core SDK 3.1
    - name: Setup .NET Core SDK
      uses: actions/setup-dotnet@v2.1.0
      with:
        dotnet-version: 3.1
        
     # publishes Blazor project to the release-folder
    - name: Publish .NET Core Project
      run: dotnet publish Learning_Blazor.csproj -c Release -o release --nologo
      
    - name: Deploy GitHub Pages site
      uses: actions/deploy-pages@v1.0.10
      with:
         token: github.token

Can someone suggest a fix?

0 Answers
Related