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 mcr.microsoft.com/dotnet/core/sdk:2.1 AS build-env
WORKDIR /app

COPY *.csproj ./
RUN dotnet restore

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

FROM mcr.microsoft.com/dotnet/core/aspnet:2.1
WORKDIR /app
COPY --from=build-env /app/out .
ENTRYPOINT ["dotnet", "MyAPI.dll"]

My file structure is as below:

screenshot of the file structure

Source: StackOverflow