title: Azure Devops Pipeline - file not found in build context
body: <p>Getting an error in the Azure DevOps Pipeline:</p>
  <pre><code>Step 7/17 : COPY [&quot;demo6/demo6.csproj&quot;, &quot;demo6/&quot;]
  COPY failed: file not found in build context or excluded by .dockerignore: stat demo6/demo6.csproj: file does not exist
  
  </code></pre>
  <p>NOTES-run the pipeline in diagnostics mode and the .sln file exists</p>
  <pre><code>##[debug]cwd=/home/vsts/work/1/s
  ##[debug]  /home/vsts/work/1/s/demo6.sln (file)
  ##[debug]  /home/vsts/work/1/s/demo6/demo6.csproj (file)
  </code></pre>
  <p>I have a multi-project Asp.Net Core solution with the folder structure and projects as follows:</p>
  <pre><code>demo6
   |--demo6/demo6.csproj
   |--demo6.api/demo6.api.csproj
  </code></pre>
  <p>The app is demo6 which references demo6.api which is a class library.</p>
  <p>This is in GitHub in a repository demo6. I modified the autogenerated Dockerfile to add the extra demo6/ to see if that works but no.</p>
  <p>Appreciate any help.</p>
  <p>Dockerfile below:</p>
  <pre><code>FROM mcr.microsoft.com/dotnet/aspnet:3.1 AS base
  WORKDIR /app
  EXPOSE 80
  EXPOSE 443
  
  FROM mcr.microsoft.com/dotnet/sdk:3.1 AS build
  WORKDIR /src
  COPY [&quot;demo6/demo6.csproj&quot;, &quot;demo6/&quot;]
  RUN dotnet restore &quot;demo6/demo6.csproj&quot;
  COPY . .
  WORKDIR &quot;/src/demo6&quot;
  RUN dotnet build &quot;demo6.csproj&quot; -c Release -o /app/build
  
  FROM build AS publish
  RUN dotnet publish &quot;demo6.csproj&quot; -c Release -o /app/publish
  
  FROM base AS final
  WORKDIR /app
  COPY --from=publish /app/publish .
  ENTRYPOINT [&quot;dotnet&quot;, &quot;demo6.dll&quot;]
  </code></pre>
  <p>Also tried this:</p>
  <pre><code>FROM mcr.microsoft.com/dotnet/aspnet:3.1 AS base
  WORKDIR /app
  EXPOSE 80
  EXPOSE 443
  
  FROM mcr.microsoft.com/dotnet/sdk:3.1 AS build
  WORKDIR /src
  COPY [&quot;demo6/demo6/demo6.csproj&quot;, &quot;ddemo6/&quot;]
  RUN dotnet restore &quot;ddemo6/demo6.csproj&quot;
  COPY . .
  WORKDIR &quot;/src/ddemo6&quot;
  RUN dotnet build &quot;demo6.csproj&quot; -c Release -o /app/build
  
  FROM build AS publish
  RUN dotnet publish &quot;demo6.csproj&quot; -c Release -o /app/publish
  
  FROM base AS final
  WORKDIR /app
  COPY --from=publish /app/publish .
  ENTRYPOINT [&quot;dotnet&quot;, &quot;demo6.dll&quot;]
  </code></pre>
  <p>Got this error:</p>
  <pre><code>Step 7/17 : COPY [&quot;demo6/demo6/demo6.csproj&quot;, &quot;ddemo6/&quot;]
  COPY failed: file not found in build context or excluded by .dockerignore: stat demo6/demo6/demo6.csproj: file does not exist
  ##[error]COPY failed: file not found in build context or excluded by .dockerignore: stat demo6/demo6/demo6.csproj: file does not exist
  </code></pre>
  <p>here's the repo structure<a href="https://i.stack.imgur.com/VpqKv.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/VpqKv.png" alt="enter image description here" /></a></p>