Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/.net/24.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 我可以用Jenkins在Ubuntu上构建C项目吗?_C#_.net_Linux_Jenkins - Fatal编程技术网

C# 我可以用Jenkins在Ubuntu上构建C项目吗?

C# 我可以用Jenkins在Ubuntu上构建C项目吗?,c#,.net,linux,jenkins,C#,.net,Linux,Jenkins,我们有Jenkins在UbuntuOS18.04.01LTS和一个用C/.NET4.5编写的旧项目上运行 在过去,应用程序总是手工构建的,我想用Jenkins来介绍CI,这样就没有人再需要手工构建项目了。该应用程序不必在Linux或类似的平台上运行,我们只需要构建文件、可执行文件和DLL文件。有可能在Ubuntu上用Jenkins构建这个C解决方案吗 我知道MONO和XBUILD,但实际上我无法在ubuntu下构建该项目,因为在Windows下不会出现不同的问题,例如,请参见此处: UserC

我们有Jenkins在UbuntuOS18.04.01LTS和一个用C/.NET4.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


尝试先手动构建,然后与jenkins集成。

要消除这些错误,需要在.csproj中指定C版本7。本文可能会对您有所帮助:如上所述,我尝试了此方法,但无法使用xbuild构建项目。有什么限制吗?您使用的是高级C功能,我认为这是C 7功能。使用最新的mono版本。你使用的是什么mono版本?我刚刚制作了第二个基于Windows的jenkins worker,以避免任何其他冲突-看起来更容易。尽管如此,我还是接受了你的答案,因为xbuild/mono是在Linux上构建C项目的唯一方法。