C
C#4mo ago
thomas

"x.csproj": not found in GH actions

Getting this funny error right here while trying to auto publish my app on GH packages
No description
45 Replies
thomas
thomasOP4mo ago
Here is what the docker file looks like:
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
USER $APP_UID
WORKDIR /app
EXPOSE 8080
EXPOSE 8081

FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
ARG BUILD_CONFIGURATION=Release
WORKDIR /src
COPY ["Attendance.API/Attendance.API.csproj", "Attendance.API/"]
RUN dotnet restore "Attendance.API/Attendance.API.csproj"
COPY . .
WORKDIR "/src/Attendance.API"
RUN dotnet build "Attendance.API.csproj" -c $BUILD_CONFIGURATION -o /app/build

FROM build AS publish
ARG BUILD_CONFIGURATION=Release
RUN dotnet publish "Attendance.API.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false

FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "Attendance.API.dll"]
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
USER $APP_UID
WORKDIR /app
EXPOSE 8080
EXPOSE 8081

FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
ARG BUILD_CONFIGURATION=Release
WORKDIR /src
COPY ["Attendance.API/Attendance.API.csproj", "Attendance.API/"]
RUN dotnet restore "Attendance.API/Attendance.API.csproj"
COPY . .
WORKDIR "/src/Attendance.API"
RUN dotnet build "Attendance.API.csproj" -c $BUILD_CONFIGURATION -o /app/build

FROM build AS publish
ARG BUILD_CONFIGURATION=Release
RUN dotnet publish "Attendance.API.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false

FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "Attendance.API.dll"]
Unknown User
Unknown User4mo ago
Message Not Public
Sign In & Join Server To View
thomas
thomasOP4mo ago
GitHub
GitHub - classy-giraffe/unims
Contribute to classy-giraffe/unims development by creating an account on GitHub.
thomas
thomasOP4mo ago
it build just fine on my pc tho
Unknown User
Unknown User4mo ago
Message Not Public
Sign In & Join Server To View
thomas
thomasOP4mo ago
yh its kinda like doing cd /some/folder and the subsequent commands will be ran using that folder as base
Unknown User
Unknown User4mo ago
Message Not Public
Sign In & Join Server To View
thomas
thomasOP4mo ago
this is my structure
No description
thomas
thomasOP4mo ago
from the dockerfile pov, Attendance.API/Attendance.API.csproj is valid i can't see how it wouldn't
Unknown User
Unknown User4mo ago
Message Not Public
Sign In & Join Server To View
thomas
thomasOP4mo ago
exactly i have no idea how does that even come out
Unknown User
Unknown User4mo ago
Message Not Public
Sign In & Join Server To View
thomas
thomasOP4mo ago
sum like Employee.API?
thomas
thomasOP4mo ago
same error
No description
thomas
thomasOP4mo ago
im going fuckin crazy
Unknown User
Unknown User4mo ago
Message Not Public
Sign In & Join Server To View
thomas
thomasOP4mo ago
I acc know what happened lol i renamed the project and i trusted the rider refactor thingy too much
Unknown User
Unknown User4mo ago
Message Not Public
Sign In & Join Server To View
thomas
thomasOP4mo ago
Now im getting this
No description
thomas
thomasOP4mo ago
@TeBeCo i feel like this is the reason here
No description
thomas
thomasOP4mo ago
but this is not true since those files exist
Unknown User
Unknown User4mo ago
Message Not Public
Sign In & Join Server To View
thomas
thomasOP4mo ago
it build just fine on docker w those path
No description
Unknown User
Unknown User4mo ago
Message Not Public
Sign In & Join Server To View
MODiX
MODiX4mo ago
ARG DOTNET_VERSION=8.0
FROM mcr.microsoft.com/dotnet/sdk:${DOTNET_VERSION} AS build
WORKDIR /sln

COPY ./*.sln ./nuget.config ./

# Copy the main source project files
COPY src/*/*.csproj ./
RUN for file in $(ls *.csproj); do mkdir -p src/${file%.*}/ && mv $file src/${file%.*}/; done

# Copy the test project files
COPY test/*/*.csproj ./
RUN for file in $(ls *.csproj); do mkdir -p test/${file%.*}/ && mv $file test/${file%.*}/; done

RUN dotnet restore

# possible FROM .... for multi stage here
COPY . .
RUN dotnet build

RUN dotnet publish --project src/Your.Project/Your.Project.csproj -c Release -o /publish --no-restore

# final stage/image
ARG DOTNET_VERSION=8.0
FROM mcr.microsoft.com/dotnet/aspnet:${DOTNET_VERSION}
WORKDIR /app
COPY --from=build /publish .
ENTRYPOINT ["dotnet", "Your.Project.dll"]
ARG DOTNET_VERSION=8.0
FROM mcr.microsoft.com/dotnet/sdk:${DOTNET_VERSION} AS build
WORKDIR /sln

COPY ./*.sln ./nuget.config ./

# Copy the main source project files
COPY src/*/*.csproj ./
RUN for file in $(ls *.csproj); do mkdir -p src/${file%.*}/ && mv $file src/${file%.*}/; done

# Copy the test project files
COPY test/*/*.csproj ./
RUN for file in $(ls *.csproj); do mkdir -p test/${file%.*}/ && mv $file test/${file%.*}/; done

RUN dotnet restore

# possible FROM .... for multi stage here
COPY . .
RUN dotnet build

RUN dotnet publish --project src/Your.Project/Your.Project.csproj -c Release -o /publish --no-restore

# final stage/image
ARG DOTNET_VERSION=8.0
FROM mcr.microsoft.com/dotnet/aspnet:${DOTNET_VERSION}
WORKDIR /app
COPY --from=build /publish .
ENTRYPOINT ["dotnet", "Your.Project.dll"]
thomas
thomasOP4mo ago
Your.Project would Employee.API and Attendance.API?
Unknown User
Unknown User4mo ago
Message Not Public
Sign In & Join Server To View
thomas
thomasOP4mo ago
mind that i didnt write those i let rider create em
Unknown User
Unknown User4mo ago
Message Not Public
Sign In & Join Server To View
thomas
thomasOP4mo ago
the attendance build fine on desktop the employee one says
[+] Building 0.1s (9/17) docker:default
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 751B 0.0s
=> [internal] load metadata for mcr.microsoft.com/dotnet/sdk:8.0 0.0s
=> [internal] load metadata for mcr.microsoft.com/dotnet/aspnet:8.0 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> [base 1/2] FROM mcr.microsoft.com/dotnet/aspnet:8.0 0.0s
=> [internal] load build context 0.0s
=> => transferring context: 12.90kB 0.0s
=> [build 1/7] FROM mcr.microsoft.com/dotnet/sdk:8.0 0.0s
=> CACHED [build 2/7] WORKDIR /src 0.0s
=> ERROR [build 3/7] COPY [Employee.API/Employee.API.csproj, Employee.AP 0.0s
------
> [build 3/7] COPY [Employee.API/Employee.API.csproj, Employee.API/]:
------
Dockerfile:10
--------------------
8 | ARG BUILD_CONFIGURATION=Release
--------------------
8 | ARG BUILD_CONFIGURATION=Release
9 | WORKDIR /src
10 | >>> COPY ["Employee.API/Employee.API.csproj", "Employee.API/"]
11 | RUN dotnet restore "Employee.API/Employee.API.csproj"
12 | COPY . .
--------------------
ERROR: failed to solve: failed to compute cache key: failed to calculate checksum of ref 766f2962-5685-41a0-bf7b-d8e382db57bb::e3tc7wu2zkk1slz5gk9mtfg7k: "/Employee.API/Employee.API.csproj": not found

View build details: docker-desktop://dashboard/build/default/default/tcv6c7myfppirl1wdanvk1qal
[+] Building 0.1s (9/17) docker:default
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 751B 0.0s
=> [internal] load metadata for mcr.microsoft.com/dotnet/sdk:8.0 0.0s
=> [internal] load metadata for mcr.microsoft.com/dotnet/aspnet:8.0 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> [base 1/2] FROM mcr.microsoft.com/dotnet/aspnet:8.0 0.0s
=> [internal] load build context 0.0s
=> => transferring context: 12.90kB 0.0s
=> [build 1/7] FROM mcr.microsoft.com/dotnet/sdk:8.0 0.0s
=> CACHED [build 2/7] WORKDIR /src 0.0s
=> ERROR [build 3/7] COPY [Employee.API/Employee.API.csproj, Employee.AP 0.0s
------
> [build 3/7] COPY [Employee.API/Employee.API.csproj, Employee.API/]:
------
Dockerfile:10
--------------------
8 | ARG BUILD_CONFIGURATION=Release
--------------------
8 | ARG BUILD_CONFIGURATION=Release
9 | WORKDIR /src
10 | >>> COPY ["Employee.API/Employee.API.csproj", "Employee.API/"]
11 | RUN dotnet restore "Employee.API/Employee.API.csproj"
12 | COPY . .
--------------------
ERROR: failed to solve: failed to compute cache key: failed to calculate checksum of ref 766f2962-5685-41a0-bf7b-d8e382db57bb::e3tc7wu2zkk1slz5gk9mtfg7k: "/Employee.API/Employee.API.csproj": not found

View build details: docker-desktop://dashboard/build/default/default/tcv6c7myfppirl1wdanvk1qal
Unknown User
Unknown User4mo ago
Message Not Public
Sign In & Join Server To View
thomas
thomasOP4mo ago
this is on desktop when i fixed gh action desktop broke lmfao
Unknown User
Unknown User4mo ago
Message Not Public
Sign In & Join Server To View
thomas
thomasOP4mo ago
see tho
No description
Unknown User
Unknown User4mo ago
Message Not Public
Sign In & Join Server To View
thomas
thomasOP4mo ago
oh
Unknown User
Unknown User4mo ago
Message Not Public
Sign In & Join Server To View
thomas
thomasOP4mo ago
im using
No description
Unknown User
Unknown User4mo ago
Message Not Public
Sign In & Join Server To View
thomas
thomasOP4mo ago
my compose build them just fine tho
No description
Unknown User
Unknown User4mo ago
Message Not Public
Sign In & Join Server To View
thomas
thomasOP4mo ago
id like to fix the gh action first tho
Unknown User
Unknown User4mo ago
Message Not Public
Sign In & Join Server To View
thomas
thomasOP4mo ago
GH is nearly fixed, build happens correctly i'm getting a 403 here now lol
thomas
thomasOP4mo ago
No description
Want results from more Discord servers?
Add your server