You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When attempting to build a Docker image for a .NET application using the .NET SDK 9.0.100 Docker image, the dotnet restore command fails with a System.NullReferenceException. The error originates from the Message task within MSBuild, indicating an internal issue with the SDK's build process.
FROM mcr.microsoft.com/dotnet/aspnet:9.0-bookworm-slim-arm64v8 AS base
USER $APP_UID
WORKDIR /app
FROM mcr.microsoft.com/dotnet/sdk:9.0-bookworm-slim-arm64v8 AS build
ARG BUILD_CONFIGURATION=Production
ENV ASPNETCORE_ENVIRONMENT=Production
WORKDIR /src
COPY ["src/App/App.csproj", "src/App/"]
RUN dotnet restore "src/App/App.csproj"
COPY . .
WORKDIR "/src/src/App"
RUN dotnet build "App.csproj" -c $BUILD_CONFIGURATION -o /app/build
FROM build AS publish
ENV ASPNETCORE_ENVIRONMENT=Production
RUN dotnet publish "App.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "App.dll"]
Exceptions (if any)
/usr/share/dotnet/sdk/9.0.100/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.DefaultItems.Shared.targets(93,5): error MSB4018: The "CheckIfPackageReferenceShouldBeFrameworkReference" task failed unexpectedly. [/src/src/App/App.csproj]
/usr/share/dotnet/sdk/9.0.100/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.DefaultItems.Shared.targets(93,5): error MSB4018: System.NullReferenceException: Object reference not set to an instance of an object. [/src/src/App/App.csproj]
/usr/share/dotnet/sdk/9.0.100/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.DefaultItems.Shared.targets(93,5): error MSB4018: at InvokeStub_CheckIfPackageReferenceShouldBeFrameworkReference.set_FrameworkReferences(Object, Object, IntPtr*) [/src/src/App/App.csproj]
/usr/share/dotnet/sdk/9.0.100/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.DefaultItems.Shared.targets(93,5): error MSB4018: at System.Reflection.MethodBaseInvoker.InvokeDirectByRefWithFewArgs(Object obj, Span`1 copyOfArgs, BindingFlags invokeAttr) [/src/src/App/App.csproj]
/usr/share/dotnet/sdk/9.0.100/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.DefaultItems.Shared.targets(95,7): error MSB4026: The "FrameworkReferences=@(FrameworkReference)" parameter for the "CheckIfPackageReferenceShouldBeFrameworkReference" task is invalid. [/src/src/App/App.csproj]
/usr/share/dotnet/sdk/9.0.100/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.DefaultItems.Shared.targets(93,5): error MSB4063: The "CheckIfPackageReferenceShouldBeFrameworkReference" task could not be initialized with its input parameters. [/src/src/App/App.csproj]
.NET Version
9.0.100
Anything else?
IDE: JetBrains Rider 2024.3 RC 1
Dotnet info:
.NET SDK:
Version: 9.0.100
Commit: 59db016f11
Workload version: 9.0.100-manifests.3068a692
MSBuild version: 17.12.7+5b8665660
Runtime Environment:
OS Name: Windows
OS Version: 10.0.22631
OS Platform: Windows
RID: win-x64
Base Path: C:\Program Files\dotnet\sdk\9.0.100\
.NET workloads installed:
There are no installed workloads to display.
Configured to use loose manifests when installing new manifests.
Host:
Version: 9.0.0
Architecture: x64
Commit: 9d5a6a9aa4
.NET SDKs installed:
7.0.203 [C:\Program Files\dotnet\sdk]
8.0.110 [C:\Program Files\dotnet\sdk]
8.0.403 [C:\Program Files\dotnet\sdk]
9.0.100 [C:\Program Files\dotnet\sdk]
.NET runtimes installed:
Microsoft.AspNetCore.App 7.0.5 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 7.0.20 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 8.0.10 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 9.0.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 3.1.32 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 5.0.17 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 7.0.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 7.0.20 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 8.0.10 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 9.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 5.0.17 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 7.0.5 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 7.0.20 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 8.0.10 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 9.0.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Other architectures found:
x86 [C:\Program Files (x86)\dotnet]
registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation]
Environment variables:
Not set
global.json file:
D:\Documents\Invix Digital\Companies\Vexel Studios\Discord Bot\Project\global.json
Describe the bug
When attempting to build a Docker image for a .NET application using the
.NET SDK 9.0.100
Docker image, thedotnet restore
command fails with aSystem.NullReferenceException
. The error originates from theMessage
task within MSBuild, indicating an internal issue with the SDK's build process.Steps To Reproduce
Github Actions:
App.csproj:
Dockerfile:
Exceptions (if any)
.NET Version
9.0.100
Anything else?
IDE:
JetBrains Rider 2024.3 RC 1
Dotnet info:
Original issue
dotnet/aspnetcore#58907
The text was updated successfully, but these errors were encountered: