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
To reproduce this create a new ASP CORE WebApi NET10 Project (make sure to include the Docker support) and switch to use ManagePackageVersionsCentrally and CentralPackageTransitivePinningEnabled
You'll now get the following error:
1> #12 [build 4/7] RUN dotnet restore "./DockerBuildTest/DockerBuildTest.csproj"
1> #12 0.836 Determining projects to restore...
1> #12 1.121 /src/DockerBuildTest/DockerBuildTest.csproj : error NU1015: The following PackageReference item(s) do not have a version specified: Microsoft.AspNetCore.OpenApi, Microsoft.VisualStudio.Azure.Containers.Tools.Targets
1> #12 1.194 Failed to restore /src/DockerBuildTest/DockerBuildTest.csproj (in 42 ms).
1> #12 ERROR: process "/bin/sh -c dotnet restore \"./DockerBuildTest/DockerBuildTest.csproj\"" did not complete successfully: exit code:
After fiddling a bit, this problem is resolved when also copying the Directory.Packages.props file in Dockerfile: COPY ["Directory.Packages.props", "./"]
Is this the correct approach or is the issue elsewhere?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
To reproduce this create a new ASP CORE WebApi NET10 Project (make sure to include the Docker support) and switch to use
ManagePackageVersionsCentrallyandCentralPackageTransitivePinningEnabledYou'll now get the following error:
After fiddling a bit, this problem is resolved when also copying the
Directory.Packages.propsfile inDockerfile:COPY ["Directory.Packages.props", "./"]Is this the correct approach or is the issue elsewhere?
Beta Was this translation helpful? Give feedback.
All reactions