Closed sroy2020 closed 3 years ago
@sroy2020 thanks for contacting us.
That seems like an issue with the installation on your build machine. I would suggest you repair the installation or try downloading and using the 5.1.102 SDK binaries and use that directly. For that:
$env:DOTNET_ROOT = $dotNetFolder;
$env:DOTNET_MULTILEVEL_LOOKUP = 0;
$env:Path = "$dotNetFolder;$env:Path";
Where dotnet folder is the path to where you unzipped the dotnet binaries.
If you do dotnet --info
after that, it should only point to that binary distribution.
Then create a new blazor webassembly application and build it. If it works, it means that there's some issue in your installation, so I would suggest reinstalling the SDK
Hi,
I downloaded and installed the binaries using the zip and then followed the procedure. Unfortunately, I get the same error. Below is the output captured in text and as a screenshot.
Do you have any other recommendations?
Thanks in advance Stéphane Roy
PS C:\Users\SRoy> cd x
PS C:\Users\SRoy\x> $env:DOTNET_ROOT = "C:\Tmp\dotnet-sdk-5.0.102-win-x64"
PS C:\Users\SRoy\x> $env:DOTNET_MULTILEVEL_LOOKUP = 0;
PS C:\Users\SRoy\x> $env:Path = "C:\Tmp\dotnet-sdk-5.0.102-win-x64;$env:Path";
PS C:\Users\SRoy\x> ls
PS C:\Users\SRoy\x> dotnet --info
.NET SDK (reflecting any global.json):
Version: 5.0.102
Commit: 71365b4d42
Runtime Environment:
OS Name: Windows
OS Version: 10.0.17763
OS Platform: Windows
RID: win10-x64
Base Path: C:\Tmp\dotnet-sdk-5.0.102-win-x64\sdk\5.0.102\
Host (useful for support):
Version: 5.0.2
Commit: cb5f173b96
.NET SDKs installed:
5.0.102 [C:\Tmp\dotnet-sdk-5.0.102-win-x64\sdk]
.NET runtimes installed:
Microsoft.AspNetCore.App 5.0.2 [C:\Tmp\dotnet-sdk-5.0.102-win-x64\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 5.0.2 [C:\Tmp\dotnet-sdk-5.0.102-win-x64\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 5.0.2 [C:\Tmp\dotnet-sdk-5.0.102-win-x64\shared\Microsoft.WindowsDesktop.App]
To install additional .NET runtimes or SDKs:
https://aka.ms/dotnet-download
PS C:\Users\SRoy\x> dotnet new blazorwasm -o qwerty
The template "Blazor WebAssembly App" was created successfully.
This template contains technologies from parties other than Microsoft, see https://aka.ms/aspnetcore/5.0-third-party-notices for details.
Processing post-creation actions...
Running 'dotnet restore' on C:\Users\SRoy\x\qwerty\qwerty.csproj...
Restore succeeded.
PS C:\Users\SRoy\x> ls
Directory: C:\Users\SRoy\x
Mode LastWriteTime Length Name
---- ------------- ------ ----
d----- 1/28/2021 1:46 PM qwerty
PS C:\Users\SRoy\x> cd .\qwerty\
PS C:\Users\SRoy\x\qwerty> dotnet build
Microsoft (R) Build Engine version 16.8.3+39993bd9d for .NET
Copyright (C) Microsoft Corporation. All rights reserved.
C:\Users\SRoy\x\qwerty\qwerty.csproj : error MSB4236: The SDK 'Microsoft.NET.Sdk.BlazorWebAssembly' specified could not be found.
Build FAILED.
C:\Users\SRoy\x\qwerty\qwerty.csproj : error MSB4236: The SDK 'Microsoft.NET.Sdk.BlazorWebAssembly' specified could not be found.
0 Warning(s)
1 Error(s)
Time Elapsed 00:00:00.23
PS C:\Users\SRoy\x\qwerty>
@sroy2020 thanks for the additional details.
@pranavkm do you know what can be going on here?
There's a couple of SDK issues for this error code: https://github.com/dotnet/sdk/issues/10229, https://github.com/dotnet/msbuild/issues/2532. Can you look at the solutions posted in these issues to see if it helps?
Hi,
I can't believe it. Using the info from dotnet/sdk#10229. I found out that the env. var. MSBuildSDKsPath was set to a previous SDK. I updated it to "C:\Program Files\dotnet\sdk\5.0.102\Sdks" and now "dotnet build" is fine.
Thanks to all
This issue has been resolved and has not had any activity for 1 day. It will be closed for housekeeping purposes.
See our Issue Management Policies for more information.
Although seemingly resolved on Windows, I am getting this same original bug on Mac.
Checking the $PATH, I get:
echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/share/dotnet:~/.dotnet/tools:/Library/Apple/usr/bin:/Library/Frameworks/Mono.framework/Versions/Current/Commands
The project builds properly if built in Visual Studio, however not using the command line.
My specific error is:
error MSB4236: The SDK 'Microsoft.NET.Sdk.BlazorWebAssembly' specified could not be found.
and yet the path to the SDK is: /usr/local/share/dotnet/sdk/5.0.102/Sdks/Microsoft.NET.Sdk.BlazorWebAssembly
Describe the bug
I can't build using a build pipeline on an on-premise DevOps Server. So I decided to create a small project and compile manually on the same server. Unfortunately, I have the same error the build pipeline is reporting. The build fails with the following error
"C:\Users\SRoy\z\qwerty\qwerty.csproj : error MSB4236: The SDK 'Microsoft.NET.Sdk.BlazorWebAssembly' specified could not be found."
To Reproduce
I created a small Blazor WASM using the command "dotnet new blazorwasm -o qwerty". Then run "dotnet build" inside the qwerty folder. The build fails with the error above.
Exceptions (if any)
The SDK 'Microsoft.NET.Sdk.BlazorWebAssembly' specified could not be found."
Further technical details
qwerty.csproj contains:
global.json in qwerty folder contains:
I really don't have any clue what could be wrong. Doing the very same on my workstation is fine.
Thanks in advance Stéphane Roy