C# project build fails in github action

276 Views Asked by At

I am working on project that has several github actions. Occasionally (about 2 weeks ago) build stopped working. The build action executes command dotnet build. Now it fails with the following error:

Run dotnet build
  dotnet build
  shell: /usr/bin/bash -e {0}
  env:
    DOTNET_ROOT: /usr/share/dotnet
MSBuild version 17.8.3+195e7f5a3 for .NET
  Determining projects to restore...
  All projects are up-to-date for restore.
CSC : error CS8784: Generator 'BindableTypeProvidersSourceGenerator' failed to initialize. It will not contribute to the output and compilation errors may occur as a result. Exception was of type 'ArgumentNullException' with message 'Value cannot be null. (Parameter 'path')'. [/home/runner/work/firebolt-net-sdk/firebolt-net-sdk/FireboltNETSDK/FireboltDotNetSdk.csproj]
CSC : error CS8784: Generator 'DependencyObjectAvailabilityGenerator' failed to initialize. It will not contribute to the output and compilation errors may occur as a result. Exception was of type 'ArgumentNullException' with message 'Value cannot be null. (Parameter 'path')'. [/home/runner/work/firebolt-net-sdk/firebolt-net-sdk/FireboltNETSDK/FireboltDotNetSdk.csproj]
CSC : error CS8784: Generator 'DependencyObjectGenerator' failed to initialize. It will not contribute to the output and compilation errors may occur as a result. Exception was of type 'ArgumentNullException' with message 'Value cannot be null. (Parameter 'path')'. [/home/runner/work/firebolt-net-sdk/firebolt-net-sdk/FireboltNETSDK/FireboltDotNetSdk.csproj]
CSC : error CS8784: Generator 'DependencyPropertyGenerator' failed to initialize. It will not contribute to the output and compilation errors may occur as a result. Exception was of type 'ArgumentNullException' with message 'Value cannot be null. (Parameter 'path')'. [/home/runner/work/firebolt-net-sdk/firebolt-net-sdk/FireboltNETSDK/FireboltDotNetSdk.csproj]
CSC : error CS8784: Generator 'NativeCtorsGenerator' failed to initialize. It will not contribute to the output and compilation errors may occur as a result. Exception was of type 'ArgumentNullException' with message 'Value cannot be null. (Parameter 'path')'. [/home/runner/work/firebolt-net-sdk/firebolt-net-sdk/FireboltNETSDK/FireboltDotNetSdk.csproj]
CSC : error CS8784: Generator 'RemoteControlGenerator' failed to initialize. It will not contribute to the output and compilation errors may occur as a result. Exception was of type 'ArgumentNullException' with message 'Value cannot be null. (Parameter 'path')'. [/home/runner/work/firebolt-net-sdk/firebolt-net-sdk/FireboltNETSDK/FireboltDotNetSdk.csproj]
CSC : error CS8784: Generator 'TSBindingsGenerator' failed to initialize. It will not contribute to the output and compilation errors may occur as a result. Exception was of type 'ArgumentNullException' with message 'Value cannot be null. (Parameter 'path')'. [/home/runner/work/firebolt-net-sdk/firebolt-net-sdk/FireboltNETSDK/FireboltDotNetSdk.csproj]
CSC : error CS8784: Generator 'XamlCodeGenerator' failed to initialize. It will not contribute to the output and compilation errors may occur as a result. Exception was of type 'ArgumentNullException' with message 'Value cannot be null. (Parameter 'path')'. [/home/runner/work/firebolt-net-sdk/firebolt-net-sdk/FireboltNETSDK/FireboltDotNetSdk.csproj]

The build succeeds locally but fails on github. Moreover nothing has changed in the code: the same branch that succeded 3 weeks ago fails now. I have found only one difference between the "old" (successful) and "new" (failing) builds:

  • successful build: MSBuild version 17.7.3+4fca21998 for .NET
  • failing build: MSBuild version 17.8.3+195e7f5a3 for .NET

I am not sure that this minor difference cases the problem (17.7.3 vs 17.8.3), but I do not see other differences.

Just in case here is the information about my local environement where the build works well:

$ dotnet --info
.NET SDK (reflecting any global.json):
 Version:   6.0.125
 Commit:    e898a826c2

Runtime Environment:
 OS Name:     ubuntu
 OS Version:  22.04
 OS Platform: Linux
 RID:         ubuntu.22.04-x64
 Base Path:   /usr/lib/dotnet/sdk/6.0.125/

global.json file:
  Not found

Host:
  Version:      6.0.25
  Architecture: x64
  Commit:       492abbeef0

.NET SDKs installed:
  6.0.125 [/usr/lib/dotnet/sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 6.0.25 [/usr/lib/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 6.0.25 [/usr/lib/dotnet/shared/Microsoft.NETCore.App]

Download .NET:
  https://aka.ms/dotnet-download

Learn about .NET Runtimes and SDKs:
  https://aka.ms/dotnet/runtimes-sdk-info

Do you guys have any idea why my build is failing now and how to fix the problem?

0

There are 0 best solutions below