Infrequent 'MSB4236: The SDK 'Microsoft.NET.Sdk.Web' specified could not be found' with ubuntu 24.04 hosted runner.
The error happens in projects with <Project Sdk="Microsoft.NET.Sdk.Web"> only (<Project Sdk="Microsoft.NET.Sdk"> are fine)
Sometime build error only on projects with "Microsoft.NET.Sdk.Web"
/home/runner/work/.../some-proj1.csproj : error : Could not resolve SDK "Microsoft.NET.Sdk.Web". Exactly one of the probing messages below indicates why we could not resolve the SDK. Investigate and resolve that message to correctly specify the SDK.
/home/runner/work/.../some-proj2.csproj : error :
/home/runner/work/.../some-proj3.csproj : error MSB4236: The SDK 'Microsoft.NET.Sdk.Web' specified could not be found.
/home/runner/work/.../some-proj4.csproj : error MSB4236: The SDK 'Microsoft.NET.Sdk.Web' specified could not be found.
...
0 Warning(s)
20 Error(s)
This is the setup-dotnet action log
/home/runner/work/_actions/actions/setup-dotnet/v4/externals/install-dotnet.sh --skip-non-versioned-files --runtime dotnet --channel LTS
dotnet-install: Attempting to download using aka.ms link https://dotnetcli.azureedge.net/dotnet/Runtime/8.0.6/dotnet-runtime-8.0.6-linux-x64.tar.gz
dotnet-install: Remote file https://dotnetcli.azureedge.net/dotnet/Runtime/8.0.6/dotnet-runtime-8.0.6-linux-x64.tar.gz size is 31270581 bytes.
dotnet-install: Extracting zip from https://dotnetcli.azureedge.net/dotnet/Runtime/8.0.6/dotnet-runtime-8.0.6-linux-x64.tar.gz
cp: warning: behavior of -n is non-portable and may change in future; use --update=none instead
cp: warning: behavior of -n is non-portable and may change in future; use --update=none instead
dotnet-install: Downloaded file size is 31270581 bytes.
dotnet-install: The remote and local file sizes are equal.
dotnet-install: Installed version is 8.0.6
dotnet-install: Adding to current process PATH: `/usr/share/dotnet`. Note: This change will be visible only when sourcing script.
dotnet-install: Note that the script does not resolve dependencies during installation.
dotnet-install: To check the list of dependencies, go to https://learn.microsoft.com/dotnet/core/install, select your operating system and check the "Dependencies" section.
dotnet-install: Installation finished successfully.
/home/runner/work/_actions/actions/setup-dotnet/v4/externals/install-dotnet.sh --skip-non-versioned-files --channel 7.0
dotnet-install: Attempting to download using aka.ms link https://dotnetcli.azureedge.net/dotnet/Sdk/7.0.410/dotnet-sdk-7.0.410-linux-x64.tar.gz
dotnet-install: Remote file https://dotnetcli.azureedge.net/dotnet/Sdk/7.0.410/dotnet-sdk-7.0.410-linux-x64.tar.gz size is 218499912 bytes.
dotnet-install: Extracting zip from https://dotnetcli.azureedge.net/dotnet/Sdk/7.0.410/dotnet-sdk-7.0.410-linux-x64.tar.gz
cp: warning: behavior of -n is non-portable and may change in future; use --update=none instead
cp: warning: behavior of -n is non-portable and may change in future; use --update=none instead
cp: warning: behavior of -n is non-portable and may change in future; use --update=none instead
cp: warning: behavior of -n is non-portable and may change in future; use --update=none instead
cp: warning: behavior of -n is non-portable and may change in future; use --update=none instead
cp: warning: behavior of -n is non-portable and may change in future; use --update=none instead
cp: warning: behavior of -n is non-portable and may change in future; use --update=none instead
cp: warning: behavior of -n is non-portable and may change in future; use --update=none instead
cp: warning: behavior of -n is non-portable and may change in future; use --update=none instead
dotnet-install: Downloaded file size is 218499912 bytes.
dotnet-install: The remote and local file sizes are equal.
dotnet-install: Installed version is 7.0.410
dotnet-install: Adding to current process PATH: `/usr/share/dotnet`. Note: This change will be visible only when sourcing script.
dotnet-install: Note that the script does not resolve dependencies during installation.
dotnet-install: To check the list of dependencies, go to https://learn.microsoft.com/dotnet/core/install, select your operating system and check the "Dependencies" section.
dotnet-install: Installation finished successfully.
Description:
Infrequent 'MSB4236: The SDK 'Microsoft.NET.Sdk.Web' specified could not be found' with ubuntu 24.04 hosted runner. The error happens in projects with
<Project Sdk="Microsoft.NET.Sdk.Web">
only (<Project Sdk="Microsoft.NET.Sdk">
are fine)Task version: v4.0.0
Platform:
Runner type:
Repro steps:
actions:
global.json:
some-proj.csproj
Trigger the action.
Expected behavior: build succeed.
Actual behavior:
Sometime build error only on projects with "Microsoft.NET.Sdk.Web"
This is the setup-dotnet action log