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

我在想,只要簡要回顧一下這些內容,即可從容器中下載版本2.2.300,但我的應用程序已設置為2.0.0。 但是,我不確定如何解決它。 我可以在容器中指定2.0.0嗎? 我可以強制我的應用使用2.2.300嗎? 當我嘗試這樣做時,我無法更新多個依賴項。

科瑞

如果項目目錄中有一個名為“ global.json”的文件,則將其中的sdk目標更新為2.2.300。 如果沒有該文件,請使用以下內容創建它。

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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM