Docker Build Error for dotnetcore api: Skipping project "/MyDotnetCoreLib/MyDotnetCoreLib.csproj" because it was not found

Background on my issue. I am trying to build a docker image for a dotnet core api that has a library attached to the solution referenced inside the api.When i run the docker build command I get the warning below and then build errors because it cannot reference the library.

Skipping project “/MyDotnetCoreLib/MyDotnetCoreLib.csproj” because it was not found.

My Dockerfile

FROM AS build-env

COPY *.csproj ./
RUN dotnet restore

COPY . ./
RUN dotnet publish -c Release -o out

COPY --from=build-env /app/out .
ENTRYPOINT ["dotnet", "MyAPI.dll"]

My file structure is as below:

screenshot of the file structure

Source: StackOverflow