简体   繁体   中英

The specified framework 'Microsoft.AspNetCore.App', version '2.1.0' was not found docker in visual studio 7.5 mac

I am trying to run the project on docker on mac os X. The project build successfully however the target process exited without raising a CoreCLR started event.

Here is the list of the error

It was not possible to find any compatible framework version
The specified framework 'Microsoft.AspNetCore.App', version '2.1.0' was not found.
  - Check application dependencies and target a framework version installed at:
      /
  - Alternatively, install the framework version '2.1.0'.
The target process exited without raising a CoreCLR started event. Ensure that the target process is configured to use .NET Core. This may be expected if the target process did not run on .NET Core.The program '[14] dotnet' has exited with code 131 (0x83).

I, have added the Microsoft.AspNetCore.App '2.1.0' in every project. Here is the screen shot of the project.

包装说明

Docker File info

FROM microsoft/aspnetcore AS base
WORKDIR /app
EXPOSE 80

FROM microsoft/aspnetcore AS build
WORKDIR /src
COPY MeroRentalDev.sln ./
COPY Advetisement/Advetisement.csproj Advetisement/
RUN dotnet restore -nowarn:msb3202,nu1503
COPY . .
WORKDIR /src/Advetisement
RUN dotnet build -c Release -o /app

FROM build AS publish
RUN dotnet publish -c Release -o /app

FROM base AS final
WORKDIR /app
COPY --from=publish /app .
ENTRYPOINT ["dotnet", "Advetisement.dll"]

Dotnet info 网络信息

Updated the docker image to the latest version

docker pull microsoft/dotnet

Followed the solution from these link but still not able to solve the issue.

The specified framework 'Microsoft.AspNetCore.App', version '2.1.0' was not found

How to fix 'Microsoft.NETCore.App', version '1.1.2' was not found?

Found the solution need to change the docker file

FROM microsoft/dotnet:2.1-sdk AS base
WORKDIR /app
EXPOSE 80

FROM microsoft/dotnet:2.1-sdk AS build
WORKDIR /src
COPY MeroRentalDev.sln ./
COPY Auth.API/Auth.API.csproj Auth.API/
RUN dotnet restore -nowarn:msb3202,nu1503
COPY . .
WORKDIR /src/Auth.API
RUN dotnet build -c Release -o /app

FROM build AS publish
RUN dotnet publish -c Release -o /app

FROM base AS final
WORKDIR /app
COPY --from=publish /app .
ENTRYPOINT ["dotnet", "Auth.API.dll"]

Need to change FROM microsoft/aspnetcore AS base to FROM microsoft/dotnet:2.1-sdk AS base

What does your Dockerfile & dotnet --info look like?

I had this issue until I re-installed the latest dotnet 2.1.0 SDK, because I wasn't using the multi-arch build and was still using my local development environment which had a 2.1.0-rc1 installation, and the container itself had 2.1.0 installed.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM