是否可以在同一ASP.NET运行时容器中安装不同的ASP.NET核心框架?
我有以下dockerfile
FROM mcr.microsoft.com/dotnet/aspnet:6.0-focal
COPY ./appsettings.json /icon/Server-Files/
WORKDIR /icon
COPY ./* /icon/Server-Files/
CMD [ "dotnet", "Server-Files/Server.dll" ]
我不必构建项目,因为我只使用.dll
文件编译。
图像是构建并能够运行的。但是,我有一个试图在服务器中执行某些任务的客户端,并且我会遇到以下错误:
| The specified framework can be found at:
icon42test | It was not possible to find any compatible framework version
icon42test | The framework 'Microsoft.AspNetCore.App', version '5.0.0' (x64) was not found.
icon42test | - The following frameworks were found:
icon42test | 6.0.6 at [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
icon42test |
icon42test | You can resolve the problem by installing the specified framework and/or SDK.
有没有办法将5.0.0
框架安装到容器中?我无法理解Docker Hub上可用的不同dotnet
图像之间的区别代码>等。
由于我没有源代码,并且仅编译.dll
文件,所以我无法理解我可能需要哪些其他框架在aspnet
运行时容器中。
I have the following Dockerfile
FROM mcr.microsoft.com/dotnet/aspnet:6.0-focal
COPY ./appsettings.json /icon/Server-Files/
WORKDIR /icon
COPY ./* /icon/Server-Files/
CMD [ "dotnet", "Server-Files/Server.dll" ]
I do not have to build the project because I only have compiled .dll
files with.
The image is built and is able to run. However I have a client that is trying to conduct some tasks in the server and I keep getting the following error:
| The specified framework can be found at:
icon42test | It was not possible to find any compatible framework version
icon42test | The framework 'Microsoft.AspNetCore.App', version '5.0.0' (x64) was not found.
icon42test | - The following frameworks were found:
icon42test | 6.0.6 at [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
icon42test |
icon42test | You can resolve the problem by installing the specified framework and/or SDK.
Is there a way to install the 5.0.0
framework into the container? I am unable to comprehend the distinction between the different dotnet
images available on Docker Hub e.g. aspnet
, runtime-deps
, runtime
etc.
Since I do not have the source code and only the compiled .dll
files I am unable to understand which other frameworks I might need in the aspnet
runtime container.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我可能已经找到了一个解决方案:
事实证明,大多数
dotnet
信息都存储在/usr/share/dotnet 目录中的SDKS
dockerfile 的相应容器中语法的
复制< / code>可以使用以下内容将相关文件从容器图像复制到我当前的容器:
结果输出如下:
现在,您有必要的Runtimes / SDK在容器中。
I might have found a solution for this:
It turns out that most of the
dotnet
information is stored in the/usr/share/dotnet
directory within the respective containers for SDKsDockerfile syntax's
COPY
can be used in order to copy the relevant files from the container images to my current container using the following:The resultant output is as follows:
Now you have the necessary runtimes / SDKs in the container.