我们有 Jenkins
在 Ubuntu OS 18.04.01 LTS
上运行,还有一个用 C#
/.NET 4.5 编写的旧项目
应用程序过去总是手动构建,我想使用 Jenkins 引入 CI
,因此不再需要手动构建项目。该应用程序不必在 Linux
或类似系统上运行,我们只需要构建文件(可执行文件和 DLL 文件)。是否可以在 Ubuntu
上使用 Jenkins
构建此 C#
解决方案?
我知道 MONO
和 XBUILD
但实际上我无法在 ubuntu 下构建项目,因为在 Windows< 下不会发生不同的问题
,例如看这里:
UserControls/ExpandablePanel.cs(33,35): error CS1043: Invalid accessor body `=>', expecting `;' or `{'
UserControls/ExpandablePanel.cs(33,66): error CS1043: Invalid accessor body `=>', expecting `;' or `{'
UserControls/ExpandablePanel.cs(35,41): error CS1043: Invalid accessor body `=>', expecting `;' or `{'
UserControls/ExpandablePanel.cs(37,40): error CS1043: Invalid accessor body `=>', expecting `;' or `{'
UserControls/ExpandablePanel.cs(133,22): error CS1644: Feature `pattern matching' cannot be used because it is not part of the C# 6.0 language specification
UserControls/PagedDataGridView.cs(441,68): error CS1043: Invalid accessor body `=>', expecting `;' or `{'
1 Warning(s)
6 Error(s)
是否有可能或者我确实需要在 Windows
机器上运行 Jenkins
?
最佳答案
这是可能的。您可以在 Linux/Ubuntu 上构建 C# 项目。尝试使用 mono
构建.何时安装 mono
包,您将获得的二进制文件之一将是 xbuild
.要构建只需调用以下命令:
xbuild <path to csproj/solution file>
首先尝试手动构建它,然后与 jenkins 集成。
关于c# - 我可以使用 Jenkins 在 Ubuntu 上构建 C# 项目吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54998383/