[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
This commit is contained in:
Alessio Dal Santo
2026-02-16 16:04:36 +01:00
parent 2e25b451c9
commit 9d146d521e
+2 -2
View File
@@ -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