I am new to Docker community, when I run the sample MVC/API application which I created on .net core 3.1 using Microsoft Visual Studio Community 2019 Version 16.5.3 on windows 10 pro. I am getting couple of issues:
It was not possible to find any compatible framework version
The framework 'Microsoft.AspNetCore.App', version '3.1.0' was not found.
- The following frameworks were found:
3.1.0-preview3.19555.2 at [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
You can resolve the problem by installing the specified framework and/or SDK.
The specified framework can be found at:
- https://aka.ms/dotnet-core-applaunch?
framework=Microsoft.AspNetCore.App&framework_version=3.1.0&arch=x64&rid=win10-x64
second, When I run the application on chrome browser I am getting "This site can’t be reached". I did several things to resolve the issue but no luck.
docker ps command will give me the following data:
I am using docker for windows (Docker Desktop ver 2.2.0.5) and my docker file as follows:
FROM mcr.microsoft.com/dotnet/core/aspnet:3.1-nanoserver-1803 AS base
WORKDIR /app
EXPOSE 80
FROM mcr.microsoft.com/dotnet/core/sdk:3.1-nanoserver-1803 AS build
WORKDIR /src
COPY ["Demo_3_1/Demo_3_1.csproj", "Demo_3_1/"]
RUN dotnet restore "Demo_3_1/Demo_3_1.csproj"
COPY . .
WORKDIR "/src/Demo_3_1"
RUN dotnet build "Demo_3_1.csproj" -c Release -o /app/build
FROM build AS publish
RUN dotnet publish "Demo_3_1.csproj" -c Release -o /app/publish
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "Demo_3_1.dll"]
I have no idea what I am doing wrong here.
