代码之家  ›  专栏  ›  技术社区  ›  Flea

部署ASP.NET Core 2.1.2容器会导致“找不到指定的框架'Microsoft.ASP NET Core.All',版本'2.1.2'

  •  0
  • Flea  · 技术社区  · 6 年前

    >kubectl logs myapp -p

    It was not possible to find any compatible framework version The specified framework 'Microsoft.AspNetCore.All', version '2.1.2' 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: http://go.microsoft.com/fwlink/?LinkID=798306&clcid=0x409 - The .NET Core framework and SDK can be installed from: https://aka.ms/dotnet-download - The following versions are installed: 2.1.1 at [/usr/share/dotnet/shared/Microsoft.AspNetCore.All]

    当我检查节点上已安装的版本时,所有内容看起来都应该支持容器:

    yum info aspnetcore-runtime-2.1

    Installed Packages Name : aspnetcore-runtime-2.1 Arch : x86_64 Version : 2.1.2 Release : 1 Size : 71 M Repo : installed From repo : packages-microsoft-com-prod Summary : Microsoft ASP.NET Core 2.1.2 Shared Framework URL : https://www.asp.net/ License : Apache-2.0 Description : Shared Framework for hosting of Microsoft ASP.NET Core : applications. It is open source, cross-platform and is supported : by Microsoft. We hope you enjoy using it! If you do, please : consider joining the active community of developers that are : contributing to the project on GitHub : (https://github.com/aspnet/home). We happily accept issues and : PRs.

    yum info dotnet-sdk-2.1

    Installed Packages Name : dotnet-sdk-2.1 Arch : x86_64 Version : 2.1.400 Release : 1 Size : 221 M Repo : installed From repo : packages-microsoft-com-prod Summary : Microsoft .NET Core SDK 2.1.400 2.1.400 URL : https://github.com/dotnet/core License : MIT Description : .NET Core is a development platform that you can use to build : command-line applications, microservices and modern websites. It : is open source, cross-platform and is supported by Microsoft. We : hope you enjoy using it! If you do, please consider joining the : active community of developers that are contributing to the : project on GitHub (https://github.com/dotnet/core). We happily : accept issues and PRs.

    甚至文件夹结构(/usr/share/dotnet/shared/Microsoft.AspNetCore.All)也只有2.1.2子文件夹。

    一切看起来都应该正常,但我似乎仍然没有找到一个老版本的参考。

    1 回复  |  直到 6 年前
        1
  •  1
  •   Marcin Romaszewicz    6 年前

    在节点上安装什么并不重要,因为Kubernetes运行容器。你需要建立一个包含所有依赖项的Docker映像,并让pod运行这个Docker映像。

    让这个在Docker中工作,把这个图片推到你的Kubernetes集群可以到达的注册表中,然后在你的pods中使用这个图片。