使用官方微软dotnet docker镜像为linux上的dotnet构建

问题描述 投票:0回答:1

我正在尝试在linux主机上的官方microsoft / dotnet图像的容器中构建一个dotnet项目,因为该图像与windows和linux兼容。我只有linux主机,因此只能使用此图像作为容器用于构建点网项目。我正在发出如下命令: -

dotnet build ****.sln **arguments**

构建失败,出现如下错误: -

The imported project "/usr/share/dotnet/sdk/2.2.104/Microsoft/VisualStudio/v15.0/WebApplications/Microsoft.WebApplication.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk."

dotnet项目基于dot net framework 4.7,在我的本地我有visual studio等所以它在那里工作得很好,但如何在linux平台上使用基于microsoft / dotnet图像的容器工作呢?或者是否有任何其他可用于Linux的图像?

.net linux visual-studio docker .net-core
1个回答
1
投票

这是不可能的。 .NET Framework与Linux不兼容。您的项目需要基于与Linux兼容的.NET Core才能实现。

© www.soinside.com 2019 - 2024. All rights reserved.