From f1f75d59acc0353d9871e02a51729ebf88347f5e Mon Sep 17 00:00:00 2001 From: Alessio Dal Santo Date: Sun, 22 Mar 2026 16:18:14 +0100 Subject: [PATCH] [Fix] Dockerfile.windows: aggiunge ContinuousIntegrationBuild=true a dotnet build e publish MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Senza questo flag il target GenerateVersionJson nel .csproj veniva eseguito dentro il container Docker Windows dove: - Non esiste .git (fatal: not a git repository) - version.json copiato da COPY e' read-only o protetto → MSB3491: Access to the path '...\wwwroot\version.json' is denied Il Dockerfile Linux aveva gia /p:ContinuousIntegrationBuild=true. La condizione nel .csproj e': Condition="'' != 'true' AND '' != 'true'" quindi con il flag il target viene saltato e version.json usa quello generato dal workflow prima del docker build. --- Dockerfile.windows | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile.windows b/Dockerfile.windows index 845b62d..8a480d3 100644 --- a/Dockerfile.windows +++ b/Dockerfile.windows @@ -25,13 +25,13 @@ COPY ["Components/", "Components/"] # Build del progetto principale con output path corto WORKDIR "/s/Data_Coupler" -RUN dotnet build "Data_Coupler.csproj" -c Release -o /o --no-restore /p:MinVerVersionOverride=%APP_VERSION% +RUN dotnet build "Data_Coupler.csproj" -c Release -o /o --no-restore /p:ContinuousIntegrationBuild=true /p:MinVerVersionOverride=%APP_VERSION% # Stage 2: Publish FROM build AS publish # Necessario ridichiarare ARG dopo FROM in multi-stage build ARG APP_VERSION=0.0.0-alpha.0 -RUN dotnet publish "Data_Coupler.csproj" -c Release -o /p --no-restore -r win-x64 --self-contained false /p:MinVerVersionOverride=%APP_VERSION% +RUN dotnet publish "Data_Coupler.csproj" -c Release -o /p --no-restore -r win-x64 --self-contained false /p:ContinuousIntegrationBuild=true /p:MinVerVersionOverride=%APP_VERSION% # Stage 3: Runtime FROM mcr.microsoft.com/dotnet/aspnet:9.0-nanoserver-ltsc2022 AS final