使用GitLabCI用C# [英] Using GitLabCI with C#

查看:1101
本文介绍了使用GitLabCI用C#的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直工作在C#应用程序,并想尝试的GitLab CI。所有我能看到的是Ruby和无法找到如何建立使用它一个C#应用程序的任何信息。

I've been working on a C# application, and wanted to try out the GitLab CI. All I can see is Ruby and can't find any information on how to build a C# application using it.

当我运行测试设置,我做出承诺,但我不有我的身材。

When I run the test settings, I make the commit but I don´t have my build.

我应该怎样做一个简单的建立?我可以使用哪些命令是什么?我不介意,我得到一个失败的版本(但版本)。

How should I make a simple build? Which command could I use for that? I don´t mind if I get a failed build (but a build).

推荐答案

为了建立你一个C#应用程序。应该有一个Windows亚军(与外壳执行人)配置为Gitlab CI项目

In order to build a C# application you should have a Windows Runner (with shell executor) configured for a project in Gitlab CI.

您.gitlab-ci.yml文件应该是这个样子的:

Your .gitlab-ci.yml file should look something like that:

stages:
  - build

job:
  stage: build
  script:
  - echo "Restoring NuGet Packages..."
  - '"c:\nuget\nuget.exe" restore "MySolution.sln"'
  - ''
  - echo "Release build..."
  - C:\Windows\Microsoft.NET\Framework64\v4.0.30319\msbuild.exe /consoleloggerparameters:ErrorsOnly /maxcpucount /nologo /property:Configuration=Release /verbosity:quiet "MySolution.sln"
  tags: 
  except:
  - tags

在Windows机器上,你需要以下工具:

On Windows machine you need following tools:


  • 亚军安装

  • git的,加入到PATH

  • 在ç最新nuget.exe:\\\
    uget(或其他地方,只要确保你得到了正确的路径在.gitlab-ci.yml文件)

这篇关于使用GitLabCI用C#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆