title: Getting "Program does not contain a static 'Main' method suitable for an entry point" when building using docker, why?
body: <p>I'm running into an issue using Docker and couldn't find a proper solution.</p>
  <p>I'm trying to build a Docker image using .NET SDK 2.1.</p>
  <p>The thing is that when Docker tries to run the build statement, it fails and the error output is</p>
  <blockquote>
  <p>CSC : error CS5001: Program does not contain a static 'Main' method
  suitable for an entry point</p>
  </blockquote>
  <p>The funny thing is that if I perform the build statement on command line locally, it works fine.</p>
  <p>I have already checked my LanguageVersion tag on the project and it is 7.3.</p>
  <p>Here is my Docker file</p>
  <pre><code>FROM microsoft/dotnet:2.1-sdk AS builder  
  WORKDIR /src
  COPY ./nuget  ./nuget
  COPY ./NuGet.Config ./
  COPY Services/AadTracking ./
  
  # Copy all the referenced projects
  
  COPY ./Services/AadTracking/Company/Company.Service.AadTracking/Company.Service.AadTracking.csproj ./AadTracking/Company/Company.Service.AadTracking/Company.Service.AadTracking.csproj
  COPY ./Services/AadTracking/Office.Re.Service.AadTracking/Office.Re.Service.AadTracking.csproj ./AadTracking/Office.Re.Service.AadTracking/Office.Re.Service.AadTracking.csproj
  COPY ./Services/AadTracking/Company/Office.Re.Service.AadTracking.Company/Office.Re.Service.AadTracking.Company.csproj ./AadTracking/Company/Office.Re.Service.AadTracking.Company/Office.Re.Service.AadTracking.Company.csproj
  COPY ./Services/AadTracking/Office.Re.Service.AadTracking.EventStore/Office.Re.Service.AadTracking.EventStore.csproj ./AadTracking/Office.Re.Service.AadTracking.EventStore/Office.Re.Service.AadTracking.EventStore.csproj
  
  # Restore packages
  RUN dotnet restore &quot;./AadTracking/Company/Company.Service.AadTracking/Company.Service.AadTracking.csproj&quot;
  
  RUN dotnet build -c Debug --no-restore &quot;./AadTracking/Company/Company.Service.AadTracking/Company.Service.AadTracking.csproj&quot;
  
  # COPY source code 
  #aad tracking
  COPY ./Services/AadTracking/Company/Company.Service.AadTracking ./AadTracking/Company/Company.Service.AadTracking/
  COPY ./Services/AadTracking/Office.Re.Service.AadTracking ./AadTracking/Office.Re.Service.AadTracking/
  COPY ./Services/AadTracking/Company/Office.Re.Service.AadTracking.Company ./AadTracking/Company/Office.Re.Service.AadTracking.Company/
  COPY ./Services/AadTracking/Office.Re.Service.AadTracking.EventStore ./AadTracking/Office.Re.Service.AadTracking.EventStore/
  
  # Publish
  RUN dotnet publish &quot;./AadTracking/Company/Company.Service.AadTracking/Company.Service.AadTracking.csproj&quot; -c Debug -o &quot;../../dist&quot;
  
  # #Build the app image
  FROM microsoft/dotnet:2.1-aspnetcore-runtime  
  WORKDIR /app  
  
  ENV ASPNETCORE_ENVIRONMENT Switch
  ENV REINSURANCE_INSTANCE Docker-dev 
  
  COPY --from=builder /dist .  
  
  ENTRYPOINT [&quot;dotnet&quot;, &quot;Company.Service.AadTracking.dll&quot;]
  </code></pre>
  <p>Thanks for your help!</p>