简体   繁体   English

找不到任何兼容的框架版本找不到指定的框架'Microsoft.AspNetCore.App'版本'2.2.0'

[英]It was not possible to find any compatible framework version The specified framework 'Microsoft.AspNetCore.App', version '2.2.0' was not found

Results of docker build:
λ docker build -t simple-dotnet-api .
Sending build context to Docker daemon 252.4kB
Step 1/4 : FROM mcr.microsoft.com/dotnet/core/sdk:2.2
---> 08663b8eaa01
Step 2/4 : COPY . app/
---> 41fe9231d66e
Step 3/4 : RUN dotnet --version
---> Running in 1c8deb00927c
2.2.300
Removing intermediate container 1c8deb00927c
---> a9d0f880a76f
Step 4/4 : ENTRYPOINT ["dotnet", "app/simple-dotnet-api.dll"]
---> Running in 6d6f9bc34999
Removing intermediate container 6d6f9bc34999
---> 5e915f348c7e
Successfully built 5e915f348c7e
Successfully tagged simple-dotnet-api:latest
SECURITY WARNING: You are building a Docker image from Windows against a non-Windows Docker host. All files and directories added to build context will have '-rwxr-xr-x' permissions. It is recommended to double check and reset permissions for sensitive files and directories.

Result of docker start:
λ docker start -ia condescending_fermat
It was not possible to find any compatible framework version
The specified framework 'Microsoft.AspNetCore.App', version '2.2.0' was not found.

Check application dependencies and target a framework version installed at:
/usr/share/dotnet/
Installing .NET Core prerequisites might help resolve this problem:
https://go.microsoft.com/fwlink/?LinkID=798306&clcid=0x409
The .NET Core framework and SDK can be installed from:
https://aka.ms/dotnet-download
λ dotnet --info
A compatible SDK version for global.json version: [2.2.0] from [C:\Users\coreyp\source\repos\simple-dotnet-api\bin\Release\netcoreapp2.2\publish\global.json] was not found

Host (useful for support):
Version: 2.2.3
Commit: 6b8ad509b6

.NET Core SDKs installed:
2.1.202 [C:\Program Files\dotnet\sdk]
2.1.401 [C:\Program Files\dotnet\sdk]
2.1.504 [C:\Program Files\dotnet\sdk]
2.2.105 [C:\Program Files\dotnet\sdk]

.NET Core runtimes installed:
Microsoft.AspNetCore.All 2.1.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.1.8 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.2.3 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.1.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.1.8 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.2.3 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 2.0.9 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.1.3-servicing-26724-03 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.1.3 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.1.8 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.2.3 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]

To install additional .NET Core runtimes or SDKs:
https://aka.ms/dotnet-download

   Dockerfile:

   FROM mcr.microsoft.com/dotnet/core/sdk:2.2
   COPY . app/
   RUN dotnet --version
   ENTRYPOINT ["dotnet", "app/simple-dotnet-api.dll"]

I am thinking, just by reviewing these briefly that version 2.2.300 is being downloaded in the container but my app is setup for 2.0.0. 我在想,只要简要回顾一下这些内容,即可从容器中下载版本2.2.300,但我的应用程序已设置为2.0.0。 However, I'm not certain how to fix it. 但是,我不确定如何解决它。 Can I specify 2.0.0 in the container, if so, how? 我可以在容器中指定2.0.0吗? Can I force my app to use 2.2.300? 我可以强制我的应用使用2.2.300吗? When I tried to do so I was unable to update several dependencies. 当我尝试这样做时,我无法更新多个依赖项。

Corey 科瑞

If you have a file named "global.json" in your project directory, update the sdk target in there to 2.2.300. 如果项目目录中有一个名为“ global.json”的文件,则将其中的sdk目标更新为2.2.300。 If you don't have the file, create it with the following contents. 如果没有该文件,请使用以下内容创建它。

{
  "sdk": {
    "version": "2.2.300"
  }
}

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 找不到任何兼容的框架版本。 找不到指定的框架“Microsoft.NETCore.App”,版本“2.2.0” - It was not possible to find any compatible framework version. The specified framework 'Microsoft.NETCore.App', version '2.2.0' was not found 修复指定的框架'Microsoft.AspNetCore.App'版本'2.1.1' - Fixing The specified framework 'Microsoft.AspNetCore.App', version '2.1.1' Docker - 在构建时找不到框架 microsoft.AspNetCore.App,版本 '3.1'0 - Docker - The framework microsoft.AspNetCore.App, version '3.1'0 was not found on build 在Visual Studio 7.5 Mac中找不到指定的框架'Microsoft.AspNetCore.App'版本'2.1.0' - The specified framework 'Microsoft.AspNetCore.App', version '2.1.0' was not found docker in visual studio 7.5 mac 找不到指定的框架“Microsoft.AspNetCore.All”,版本“2.2.0” - The specified framework 'Microsoft.AspNetCore.All', version '2.2.0' was not found 控制台应用程序已更新为 .Net Core 3.1 错误找不到框架“Microsoft.AspNetCore.App”,版本“3.1.0” - Console App Updated to .Net Core 3.1 Error The framework 'Microsoft.AspNetCore.App', version '3.1.0' was not found 安装了.Net Core最新的SDK,但未找到'Framework'Microsoft.AspNetCore.App',版本'2.1.0' - .Net Core lastest SDK installed but getting 'Framework 'Microsoft.AspNetCore.App', version '2.1.0' was not found 找不到框架“Microsoft.AspNetCore.App”,版本“3.1.0”(x64) - The framework 'Microsoft.AspNetCore.App', version '3.1.0' (x64) was not found 找不到指定版本的 Microsoft.NetCore.App 或 Microsoft.AspNetCore.App。 .net 6.0升级 - The specified version of Microsoft.NetCore.App or Microsoft.AspNetCore.App was not found. .net 6.0 upgrade 未找到 Microsoft.NetCore.App 或 Microsoft.AspNetCore.App 的指定版本 - The specified version of Microsoft.NetCore.App or Microsoft.AspNetCore.App was not found
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM