From 9d146d521e424df222fb500a7f1a701147158f0f Mon Sep 17 00:00:00 2001 From: Alessio Dal Santo Date: Mon, 16 Feb 2026 16:04:36 +0100 Subject: [PATCH] [Fix] Risolto errore NETSDK1047 nella build Docker Windows - Aggiunto --runtime win-x64 al comando restore - Specificato -r win-x64 --self-contained false nella publish - Il restore ora genera project.assets.json per net9.0/win-x64 - Sintassi corretta: --self-contained false invece di /p:SelfContained=false --- Dockerfile.windows | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile.windows b/Dockerfile.windows index 26d2791..402475d 100644 --- a/Dockerfile.windows +++ b/Dockerfile.windows @@ -13,7 +13,7 @@ COPY ["Components/Components.csproj", "Components/"] COPY ["nuget.config", "./"] # Ripristina le dipendenze per tutti i progetti con package cache ultra-corto -RUN dotnet restore "Data_Coupler/Data_Coupler.csproj" --disable-parallel --packages /p +RUN dotnet restore "Data_Coupler/Data_Coupler.csproj" --runtime win-x64 --disable-parallel --packages /p # Copia tutto il codice sorgente COPY ["Data_Coupler/", "Data_Coupler/"] @@ -27,7 +27,7 @@ RUN dotnet build "Data_Coupler.csproj" -c Release -o /o --no-restore # Stage 2: Publish FROM build AS publish -RUN dotnet publish "Data_Coupler.csproj" -c Release -o /p --no-restore /p:SelfContained=false +RUN dotnet publish "Data_Coupler.csproj" -c Release -o /p --no-restore -r win-x64 --self-contained false # Stage 3: Runtime FROM mcr.microsoft.com/dotnet/aspnet:9.0-nanoserver-ltsc2022 AS final