指定的框架' Microsoft.AspNetCore.App',版本' 2.1.0'在visual studio 7.5 mac中找不到docker

时间:2018-06-08 14:34:20

标签: c# asp.net asp.net-mvc docker asp.net-core

我正在尝试在mac os X上的docker上运行该项目。项目已成功构建,但目标进程已退出而未引发CoreCLR启动事件。

以下是错误列表

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).

我已经添加了Microsoft.AspNetCore.App' 2.1.0'在每个项目中。这是该项目的屏幕截图。

package description

Docker文件信息

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信息 dotnet info

将泊坞窗图像更新为最新版本

docker pull microsoft/dotnet

遵循这些链接的解决方案,但仍然无法解决问题。

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?

2 个答案:

答案 0 :(得分:1)

发现解决方案需要更改docker文件

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"]

需要将 FROM microsoft / aspnetcore AS base 更改为 FROM microsoft / dotnet:2.1-sdk AS base

答案 1 :(得分:0)

你的Dockerfile& dotnet --info看起来像?

我遇到了这个问题,直到我重新安装了最新的dotnet 2.1.0 SDK,因为我没有使用多arch构建,并且仍在使用我的本地开发环境,它安装了2.1.0-rc1,并且容器本身安装了2.1.0。