.Net 5 - Azure Pipeline - The SDK 'Microsoft.NET.Sdk.BlazorWebAssembly' specified could not be found

Augusto Barreto

I just upgraded a Blazor Web Assembly solution to .Net 5 and I'm getting the following error in an Azure Pipeline in the NuGet Command step:

error MSB4236: The SDK 'Microsoft.NET.Sdk.BlazorWebAssembly' specified could not be found

The azure-pipelines.yml file is the following:

trigger:
- develop

pool:
  vmImage: 'windows-latest'

variables:
  solution: 'SomeProjectNew.sln'
  buildPlatform: 'Any CPU'
  buildConfiguration: 'Release'

steps:
- task: NuGetToolInstaller@1

- task: NuGetCommand@2
  inputs:
    restoreSolution: '$(solution)'

- task: VSBuild@1
  inputs:
    solution: 'SomeProjectNew.sln'
    msbuildArgs: '/p:DeployOnBuild=true /p:PublishProfile=SomeProject-demo /p:Password=$(SomeProjectDemoWebDeployPassword)'
    platform: '$(buildPlatform)'
    configuration: '$(buildConfiguration)'

Am I missing some step in the pipeline configuration to make this work with .Net 5 and the new blazor sdk?

PatrickLu-MSFT

Since you are using .Net 5, instead of using Nuget command, try to use Use .net core taskand Dotnet core task with restore command.

- task: UseDotNet@2
  displayName: 'Use .NET Core sdk 5.0.100-rc.1.20452.10'
  inputs:
    packageType: 'sdk'
    version: '5.0.100'
    includePreviewVersions: true

- task: DotNetCoreCLI@2
  displayName: 'dotnet restore'
  inputs:
    command: restore
    projects: '**/*.csproj'

It's strongly recommended to use dotnet restore and dotnet build tasks for projects that target .net core. See this statement from Nuget task:

Also take a look at this similar question here: Azure CI pipeline for Blazor .NET 5 doesn't work

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

What are the differences between Microsoft.NET.Sdk and Microsoft.NET.Sdk.Web

Version conflict caused by Microsoft.NET.Sdk.Functions

Visual studio 2017 Update 3 - The SDK 'Microsoft.NET.Sdk.Web' specified could not be found

Microsoft Dynamics 365 SDK Core Assemblies .NET Core Porting Error

.Net Core lastest SDK installed but getting 'Framework 'Microsoft.AspNetCore.App', version '2.1.0' was not found

The Specified SDK "Microsoft.NET.Sdk" was not Found

VS Test failing in Pipelines with missing 'Microsoft.NET.Test.Sdk'

.NET Core 3.1 application not building on Azure pipeline anymore (.NET 5)

Microsoft Graph SDK .NET get events in range

azure-sdk-for-net throws an exception on Mac

AWS .NET SDK SimpleEmail SendEmail returning 'Could not load type' error

How upload blob in Azure Blob Storage with specified ContentType with .NET v12 SDK?

How to publish pipeline in Azure Data Factory enabled with DeVOPS GIT repo using .NET Data Factory SDK (C# )?

Run & monitor ADF pipeline run using .NET SDK

Msbuild failed when processing the file 'FILE LOCATION' with message: The SDK 'Microsoft.NET.Sdk' specified could not be found

Ordering by complex types in Azure Search .NET SDK?

azure-sdk-for-net:Compiling source code

Does Azure SDK 4 .NET support Azure gov?

Microsoft C# Extension for VSCode cannot find .NET Core SDK

Microsoft.xrm.Sdk referenced in .Net core and .Net standards

Azure DevOps build: "sdk\2.1.515\ [...] not found. Check that a recent enough .NET Core SDK is installed or increase the version in global.json"

Add permissions to an Azure application by using the .net SDK

Can the .NET 5 SDK be used to compile .NET Core 3.1 projects?

Query Cosmos DB to get a list of different derived types using the .Net SDK Microsoft.Azure.Cosmos

How to create a User delegation SAS key for Azure Blob access using old Microsoft.WindowsAzure .NET SDK?

Upload blob into Azure Blob Storage with specified ContentType and overwrite same time (.NET v12 SDK)?

.NET EF Core - The specified field could not be found for property

How to add Middleware in Azure HttpTrigger Functions (Microsoft.NET.Sdk.Functions) in .net

How to add Middleware in Azure HttpTrigger Functions (in-process function app) (Microsoft.NET.Sdk.Functions) in .net