【问题标题】:TeamCity Docker Build Agent For .NET 5TeamCity Docker 为 .NET 5 构建代理
【发布时间】:2021-06-30 04:24:13
【问题描述】:

是否有适用于 .NET 5 的官方 TeamCity Docker 构建代理? jetbrains/teamcity-agent 似乎只支持 .NET Core 3.1。

/usr/share/dotnet/sdk/3.1.405/Microsoft.Common.CurrentVersion.targets(1177,5): error MSB3971: The reference assemblies for ".NETFramework,Version=v5.0" were not found. You might be using an older .NET SDK to target .NET 5.0 or higher. Update Visual Studio and/or your .NET SDK.

我搜索了dockerhub,但似乎找不到。

【问题讨论】:

  • 代理使用的是 .Net Core 3.1 SDK。您可能需要构建自己的 docker 镜像,以此为基础,包含 .Net 5

标签: docker teamcity .net-5


【解决方案1】:

.NET 5 没有默认的 docker 镜像,但在官方代理镜像上安装它相当容易。

您需要以 root 身份获取 bash shell。

sudo docker exec -u 0 -it <container_id> bash

需要安装wget。

apt install wget

获取 Microsoft 软件包。

wget https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
dpkg -i packages-microsoft-prod.deb

安装 SDK。

apt-get update; \
  apt-get install -y apt-transport-https && \
  apt-get update && \
  apt-get install -y dotnet-sdk-5.0

【讨论】:

    猜你喜欢
    • 2021-09-06
    • 2011-03-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-06-27
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多