fix(docker): copy Directory.Packages.props into the build image

The Dockerfile restore stage copied every .csproj but not
Directory.Packages.props, so Central Package Management (adopted in 9c60592)
had no version source inside the container and 'dotnet restore' failed NU1015
('PackageReference items do not have a version specified'). The image could
not be rebuilt since CPM adoption. Copy the props file above the projects.
This commit is contained in:
Joseph Doherty
2026-05-17 06:50:33 -04:00
parent 1038683c58
commit deedf45676

View File

@@ -22,6 +22,11 @@ COPY src/ScadaLink.InboundAPI/ScadaLink.InboundAPI.csproj src/ScadaLink.InboundA
COPY src/ScadaLink.ConfigurationDatabase/ScadaLink.ConfigurationDatabase.csproj src/ScadaLink.ConfigurationDatabase/
COPY src/ScadaLink.ManagementService/ScadaLink.ManagementService.csproj src/ScadaLink.ManagementService/
# Central Package Management: every .csproj declares versionless PackageReferences
# and the versions live in Directory.Packages.props. It must be present (above the
# projects) for `dotnet restore` to resolve versions — without it restore fails NU1015.
COPY Directory.Packages.props ./
# Restore NuGet packages via Host project (follows ProjectReferences to all dependencies)
# This layer is cached until any .csproj changes — source-only changes skip restore entirely
RUN dotnet restore src/ScadaLink.Host/ScadaLink.Host.csproj