title: ConsoleApp docker container requires AspNetCore
body: <p>I have a simple console application that utilizes standard Microsoft <code>Host</code> (<code>TelegramPoster.Presentation</code>). I want to build a docker image of it. Here is a <code>Dockerfile</code> that Visual Studio creates for me:</p>
  <pre><code>FROM mcr.microsoft.com/dotnet/runtime:6.0 AS base
  WORKDIR /app
  
  FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
  WORKDIR /src
  COPY [&quot;TelegramPoster.Presentation/TelegramPoster.Presentation.csproj&quot;, &quot;TelegramPoster.Presentation/&quot;]
  COPY [&quot;TelegramPoster.Domain/TelegramPoster.Domain.csproj&quot;, &quot;TelegramPoster.Domain/&quot;]
  COPY [&quot;TelegramPoster.Application/TelegramPoster.Application.csproj&quot;, &quot;TelegramPoster.Application/&quot;]
  COPY [&quot;TelegramPoster.Infrastructure/TelegramPoster.Infrastructure.csproj&quot;, &quot;TelegramPoster.Infrastructure/&quot;]
  COPY [&quot;Infrastructure.Common/Infrastructure.Common.csproj&quot;, &quot;Infrastructure.Common/&quot;]
  COPY [&quot;Application.Common/Application.Common.csproj&quot;, &quot;Application.Common/&quot;]
  COPY [&quot;DataAccess/DataAccess.csproj&quot;, &quot;DataAccess/&quot;]
  COPY [&quot;Domain.Common/Domain.Common.csproj&quot;, &quot;Domain.Common/&quot;]
  COPY [&quot;Hosted.Common/Hosted.Common.csproj&quot;, &quot;Hosted.Common/&quot;]
  RUN dotnet restore &quot;TelegramPoster.Presentation/TelegramPoster.Presentation.csproj&quot;
  COPY . .
  WORKDIR &quot;/src/TelegramPoster.Presentation&quot;
  RUN dotnet build &quot;TelegramPoster.Presentation.csproj&quot; -c Release -o /app/build
  
  FROM build AS publish
  RUN dotnet publish &quot;TelegramPoster.Presentation.csproj&quot; -c Release -o /app/publish
  
  FROM base AS final
  WORKDIR /app
  COPY --from=publish /app/publish .
  ENTRYPOINT [&quot;dotnet&quot;, &quot;TelegramPoster.Presentation.dll&quot;]
  </code></pre>
  <p>But when it comes to running a docker container based on this image I get the following output in container logs:</p>
  <pre><code>You must install or update .NET to run this application.
  App: /app/TelegramPoster.Presentation.dll
  Architecture: x64
  Framework: 'Microsoft.AspNetCore.App', version '6.0.0' (x64)
  .NET location: /usr/share/dotnet/
  No frameworks were found.
  Learn about framework resolution:
  https://aka.ms/dotnet/app-launch-failed
  To install missing framework, download:
  https://aka.ms/dotnet-core-applaunch?framework=Microsoft.AspNetCore.App&amp;framework_version=6.0.0&amp;arch=x64&amp;rid=debian.11-x64
  </code></pre>
  <p>Where did <code>AspNetCore.App</code> come from? Why do I even get this kind of message if I have my image built upon both Runtime and SDK of version 6.0?</p>