8 months ago
Attempting to deploy a .net 8.0 website
I am getting this error:
✕ [6/9] RUN dotnet restore
process "/bin/bash -ol pipefail -c dotnet restore" did not complete successfully: exit code: 1
I also see this warning, even though there is only one .csproj in the solution in visual studio:
MSBUILD : error MSB1011: Specify which project or solution file to use because this folder contains more than one project or solution file.|
The following is the whole build log:
deleting '/nix/store/wgqxfhs0zj7fl182nk92rsslp796cjx4-ed-1.19'
deleting '/nix/store/7nfcdvrmdbpms7wcrjjsqwkv07lswhli-gzip-1.13'
deleting '/nix/store/s806iqg5vwsnp434i5whcn1rf605y9s6-gnumake-4.4.1'
deleting '/nix/store/kfrcs055nxbkwd6yy39h5xxyrj8wrb73-xz-5.4.4'
deleting '/nix/store/yqa5m326a0ynn4whm4fikyjfljfc6i3q-gmp-with-cxx-6.3.0'
deleting '/nix/store/v553h3r3f0xqxpvb9pgzx006qrmmv12m-patchelf-0.15.0'
deleting '/nix/store/jx3kvf6mk8qdaw30dbpngwmgm4p23xdb-libxcrypt-4.4.36'
deleting '/nix/store/dc4lnyzdwfck9fc9h8h6n7di5yki5ilx-builder.pl'
deleting unused links...
note: currently hard linking saves 38.30 MiB
32 store paths deleted, 211.60 MiB freed
[4/9] RUN nix-env -if .nixpacks/nixpkgs-5148520bfab61f99fd25fb9ff7bfbb50dad3c9db.nix && nix-collect-garbage -d
40s
[5/9] COPY . /app/.
[5/9] COPY . /app/.
128ms
[6/9] RUN dotnet restore
Welcome to .NET 8.0! --------------------- SDK Version: 8.0.100-preview.5.23303.2 Telemetry --------- The .NET tools collect usage data in order to help us improve your experience. It is collected by Microsoft and shared with the community. You can opt-out of telemetry by setting the DOTNET_CLI_TELEMETRY_OPTOUT environment variable to '1' or 'true' using your favorite shell. Read more about .NET CLI Tools telemetry: https://aka.ms/dotnet-cli-telemetry
---------------- Installed an ASP.NET Core HTTPS development certificate. To trust the certificate run 'dotnet dev-certs https --trust' (Windows and macOS only). Learn about HTTPS: https://aka.ms/dotnet-https ---------------- Write your first app: https://aka.ms/dotnet-hello-world Find out what's new: https://aka.ms/dotnet-whats-new Explore documentation: https://aka.ms/dotnet-docs Report issues and find source on GitHub: https://github.com/dotnet/core Use 'dotnet --help' to see available commands or visit: https://aka.ms/dotnet-cli --------------------------------------------------------------------------------------
MSBUILD : error MSB1011: Specify which project or solution file to use because this folder contains more than one project or solution file.
✕ [6/9] RUN dotnet restore
process "/bin/bash -ol pipefail -c dotnet restore" did not complete successfully: exit code: 1
Dockerfile:19
-------------------
17 | # install phase
18 | COPY . /app/.
19 | >>> RUN dotnet restore
20 |
21 | # build phase
-------------------
ERROR: failed to build: failed to solve: process "/bin/bash -ol pipefail -c dotnet restore" did not complete successfully: exit code: 1
Error: Docker build failed
3 Replies
8 months ago
It looks like your repo contains more than one project. Try restoring the entire solution by specifying the solution file path in the restore step.
dotnet restore app.sln
8 months ago
hi, your docker build is failing because dotnet restore sees multiple project files. to fix it, either specify the exact file (e.g. RUN dotnet restore YourApp.csproj) or set WORKDIR to the project folder (so only one .csproj is in scope) before running dotnet restore.
7 months ago
you have any progress on this?