I have been tasked with deploying an email service to an Azure tenant using Windows Containers. In my Pipeline (Azure DevOps), I am receiving the following error when in the build step:
CSC : error CS5001: Program does not contain a static 'Main' method suitable for an entry point.
I believe my docker file is not correct. It was autogenerated from VS2022 and it doesn't resemble the docker files I've used in the past. Also, the Repo is TFVC.
Any assistance would be greatly appreciated.
FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base
WORKDIR /app
EXPOSE 80
EXPOSE 443
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
WORKDIR /src
#COPY ["FACTS_SendMail/FACTS_SendMail.csproj", "FACTS_SendMail/"]
COPY ["/FACTS_SendMail.csproj", "FACTS_SendMail/"]
RUN dotnet restore "FACTS_SendMail/FACTS_SendMail.csproj"
COPY . .
WORKDIR "/src/FACTS_SendMail"
RUN dotnet build "FACTS_SendMail.csproj" -c Release -o /app/build
FROM build AS publish
RUN dotnet publish "FACTS_SendMail.csproj" -c Release -o /app/publish /p:UseAppHost=false
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "FACTS_SendMail.dll"]