The projects that are not loading are on the same level as the Auth.Api project. Debug build is okay, but release build is not.
Docker file:
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
USER app
WORKDIR /app
EXPOSE 8080
EXPOSE 8081
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
ARG BUILD_CONFIGURATION=Release
WORKDIR /src
COPY ["Auth.Api/Auth.Api.csproj", "Auth.Api/"]
RUN dotnet restore "./Auth.Api/Auth.Api.csproj"
COPY . .
WORKDIR "/src/Auth.Api"
RUN dotnet build "./Auth.Api.csproj" -c $BUILD_CONFIGURATION -o /app/build
FROM build AS publish
ARG BUILD_CONFIGURATION=Release
RUN dotnet publish "./Auth.Api.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "Auth.Api.dll"]
I try build with release configuration.
Build Output:
1 docker-compose -f "C:\Users\Máté\Desktop\AuthSolution\AuthSolution\Auth\docker-compose.yml" -f "C:\Users\Máté\Desktop\AuthSolution\AuthSolution\Auth\docker-compose.override.yml" -p dockercompose16918967173923667077 --ansi never build --build-arg BUILD_CONFIGURATION=Release
1 #1 [auth.api internal] load .dockerignore
1 #1 transferring context: 464B done
1 #1 DONE 0.0s
1 #2 [auth.api internal] load build definition from Dockerfile
1 #2 transferring dockerfile: 886B done
1 #2 DONE 0.0s
1 #3 [auth.api internal] load metadata for mcr.microsoft.com/dotnet/aspnet:8.0
1 #3 DONE 0.0s
1 #4 [auth.api internal] load metadata for mcr.microsoft.com/dotnet/sdk:8.0
1 #4 DONE 0.1s
1 #5 [auth.api build 1/7] FROM mcr.microsoft.com/dotnet/sdk:8.0@sha256:a364676fedc145cf88caad4bfb3cc372aae41e596c54e8a63900a2a1c8e364c6
1 #5 DONE 0.0s
1 #6 [auth.api base 1/2] FROM mcr.microsoft.com/dotnet/aspnet:8.0
1 #6 DONE 0.0s
1 #7 [auth.api base 2/2] WORKDIR /app
1 #7 CACHED
1 #8 [auth.api final 1/2] WORKDIR /app
1 #8 CACHED
1 #9 [auth.api internal] load build context
1 #9 transferring context: 10.00kB 0.1s done
1 #9 DONE 0.1s
1 #10 [auth.api build 2/7] WORKDIR /src
1 #10 CACHED
1 #11 [auth.api build 3/7] COPY [Auth.Api/Auth.Api.csproj, Auth.Api/]
1 #11 CACHED
1 #12 [auth.api build 4/7] RUN dotnet restore "./Auth.Api/Auth.Api.csproj"
1 #12 1.229 Determining projects to restore...
1 #12 1.234 Skipping project "/Auth.Shared/Auth.Shared.csproj" because it was not found.
1 #12 1.234 Skipping project "/src/Auth.Application/Auth.Application.csproj" because it was not found.
1 #12 1.234 Skipping project "/src/Auth.Domain/Auth.Domain.csproj" because it was not found.
1 #12 1.234 Skipping project "/src/Auth.Infra/Auth.Infra.csproj" because it was not found.
1 #12 1.236 Skipping project "/Auth.Shared/Auth.Shared.csproj" because it was not found.
1 #12 1.236 Skipping project "/src/Auth.Application/Auth.Application.csproj" because it was not found.
1 #12 1.236 Skipping project "/src/Auth.Domain/Auth.Domain.csproj" because it was not found.
1 #12 1.236 Skipping project "/src/Auth.Infra/Auth.Infra.csproj" because it was not found.
1 #12 17.95 /src/Auth.Api/Auth.Api.csproj : warning NU1604: Project dependency Base.Api does not contain an inclusive lower bound. Include a lower bound in the dependency version to ensure consistent restore results.
1 #12 17.95 /src/Auth.Api/Auth.Api.csproj : warning NU1604: Project dependency Base.Application does not contain an inclusive lower bound. Include a lower bound in the dependency version to ensure consistent restore results.
1 #12 17.95 /src/Auth.Api/Auth.Api.csproj : warning NU1604: Project dependency Base.Domain does not contain an inclusive lower bound. Include a lower bound in the dependency version to ensure consistent restore results.
1 #12 17.95 /src/Auth.Api/Auth.Api.csproj : warning NU1604: Project dependency MediatR does not contain an inclusive lower bound. Include a lower bound in the dependency version to ensure consistent restore results.
1 #12 17.95 /src/Auth.Api/Auth.Api.csproj : warning NU1604: Project dependency Serilog does not contain an inclusive lower bound. Include a lower bound in the dependency version to ensure consistent restore results.
1 #12 17.95 /src/Auth.Api/Auth.Api.csproj : warning NU1604: Project dependency Serilog.Sinks.File does not contain an inclusive lower bound. Include a lower bound in the dependency version to ensure consistent restore results.
1 #12 17.95 /src/Auth.Api/Auth.Api.csproj : warning NU1604: Project dependency Serilog.Sinks.Seq does not contain an inclusive lower bound. Include a lower bound in the dependency version to ensure consistent restore results.
1 #12 17.96 /src/Auth.Api/Auth.Api.csproj : error NU1101: Unable to find package Base.Application. No packages exist with this id in source(s): nuget.org
1 #12 18.16 /src/Auth.Api/Auth.Api.csproj : warning NU1701: Package 'MediatR 0.1.0' was restored using '.NETFramework,Version=v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework,Version=v4.7.2, .NETFramework,Version=v4.8, .NETFramework,Version=v4.8.1' instead of the project target framework 'net8.0'. This package may not be fully compatible with your project.
1 #12 18.18 /src/Auth.Api/Auth.Api.csproj : warning NU1701: Package 'Portable.CommonServiceLocator 1.2.2' was restored using '.NETFramework,Version=v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework,Version=v4.7.2, .NETFramework,Version=v4.8, .NETFramework,Version=v4.8.1' instead of the project target framework 'net8.0'. This package may not be fully compatible with your project.
1 #12 18.18 /src/Auth.Api/Auth.Api.csproj : warning NU1701: Package 'Serilog 0.1.6' was restored using '.NETFramework,Version=v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework,Version=v4.7.2, .NETFramework,Version=v4.8, .NETFramework,Version=v4.8.1' instead of the project target framework 'net8.0'. This package may not be fully compatible with your project.
1 #12 18.19 /src/Auth.Api/Auth.Api.csproj : warning NU1701: Package 'Serilog.Sinks.Seq 1.4.4' was restored using '.NETFramework,Version=v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework,Version=v4.7.2, .NETFramework,Version=v4.8, .NETFramework,Version=v4.8.1' instead of the project target framework 'net8.0'. This package may not be fully compatible with your project.
1 #12 18.27 Failed to restore /src/Auth.Api/Auth.Api.csproj (in 16.65 sec).
1 #12 ERROR: process "/bin/sh -c dotnet restore \"./Auth.Api/Auth.Api.csproj\"" did not complete successfully: exit code: 1
1 failed to solve: process "/bin/sh -c dotnet restore \"./Auth.Api/Auth.Api.csproj\"" did not complete successfully: exit code: 1
1 ------
1 [auth.api build 4/7] RUN dotnet restore "./Auth.Api/Auth.Api.csproj":
1 17.95 /src/Auth.Api/Auth.Api.csproj : warning NU1604: Project dependency MediatR does not contain an inclusive lower bound. Include a lower bound in the dependency version to ensure consistent restore results.
1 17.95 /src/Auth.Api/Auth.Api.csproj : warning NU1604: Project dependency Serilog does not contain an inclusive lower bound. Include a lower bound in the dependency version to ensure consistent restore results.
1 17.95 /src/Auth.Api/Auth.Api.csproj : warning NU1604: Project dependency Serilog.Sinks.File does not contain an inclusive lower bound. Include a lower bound in the dependency version to ensure consistent restore results.
1 17.95 /src/Auth.Api/Auth.Api.csproj : warning NU1604: Project dependency Serilog.Sinks.Seq does not contain an inclusive lower bound. Include a lower bound in the dependency version to ensure consistent restore results.
1 17.96 /src/Auth.Api/Auth.Api.csproj : error NU1101: Unable to find package Base.Application. No packages exist with this id in source(s): nuget.org
1 18.16 /src/Auth.Api/Auth.Api.csproj : warning NU1701: Package 'MediatR 0.1.0' was restored using '.NETFramework,Version=v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework,Version=v4.7.2, .NETFramework,Version=v4.8, .NETFramework,Version=v4.8.1' instead of the project target framework 'net8.0'. This package may not be fully compatible with your project.
1 18.18 /src/Auth.Api/Auth.Api.csproj : warning NU1701: Package 'Portable.CommonServiceLocator 1.2.2' was restored using '.NETFramework,Version=v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework,Version=v4.7.2, .NETFramework,Version=v4.8, .NETFramework,Version=v4.8.1' instead of the project target framework 'net8.0'. This package may not be fully compatible with your project.
1 18.18 /src/Auth.Api/Auth.Api.csproj : warning NU1701: Package 'Serilog 0.1.6' was restored using '.NETFramework,Version=v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework,Version=v4.7.2, .NETFramework,Version=v4.8, .NETFramework,Version=v4.8.1' instead of the project target framework 'net8.0'. This package may not be fully compatible with your project.
1 18.19 /src/Auth.Api/Auth.Api.csproj : warning NU1701: Package 'Serilog.Sinks.Seq 1.4.4' was restored using '.NETFramework,Version=v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework,Version=v4.7.2, .NETFramework,Version=v4.8, .NETFramework,Version=v4.8.1' instead of the project target framework 'net8.0'. This package may not be fully compatible with your project.
1 18.27 Failed to restore /src/Auth.Api/Auth.Api.csproj (in 16.65 sec).