title: Gitlab CI with C# build
body: <p>I have created a C# project (<code>C# 7.0</code> &amp; <code>.net framework 4.7.2</code>) and also added some unit tests (<code>NUnit 3.11.0</code>).</p>
  
  <p>This code is stored in a Gitlab repo and I can run the tests and build locally. But now I want to automate this via the Gitlab CI. According to <a href="https://stackoverflow.com/questions/33524766/using-gitlabci-with-c-sharp/33904017#33904017">this</a> stackoverflow post and a lot of articles on the internet you should create your own runner on a Windows machine. </p>
  
  <p>But most of those answers are already pretty old and the Gitlab CI can now work with Docker images. But then I arrive at my problem. What image should I use for this runner? I've tried <a href="https://hub.docker.com/r/microsoft/dotnet-framework/" rel="noreferrer">microsoft/dotnet-framework</a> and <a href="https://hub.docker.com/r/microsoft/dotnet/" rel="noreferrer">microsoft/dotnet</a> but those didn't work. </p>
  
  <p>The <code>microsoft/dotnet-framework</code> gives the error message: <code>No such image: microsoft/dotnet-framework</code></p>
  
  <p>and the <code>microsoft/dotnet</code> images doesn't contain the <code>.net 4.7.2</code> library so it can't be used for a build. </p>
  
  <hr>
  
  <p><strong>Gitlab CI + Docker image + C# build?</strong></p>
  
  <p>Is it still not possible to create a Gitlab CI runner with a Docker image for a C# build (console application)? Or am I just doing something wrong here? </p>
  
  <p><em>My current .gitlab-ci.yml</em></p>
  
  <pre><code>image: microsoft/dotnet-framework
  
  stages:
    - build
  
  before_script:
    - 'dotnet restore'
  
  app-build:
    stage: build
    script:
      - 'dotnet build'
    only:
      - master
  </code></pre>
  
  <hr>
  
  <p><strong>Update</strong></p>
  
  <p>Do thanks to @Andreas Zita I now have an Image (<code>dsfnctnl/gitlab-dotnetcore-builder:0.15.0</code>). Unfortunately this gives me the same error as the <code>microsoft/dotnet</code>. This is probebly an error in my build script (or so I hope), but I cannot seem to find what it is. </p>
  
  <p>The error: </p>
  
  <pre><code>$ dotnet restore
    Nothing to do. None of the projects specified contain packages to restore.
  $ dotnet build
  Microsoft (R) Build Engine version 15.9.20+g88f5fadfbe for .NET Core
  Copyright (C) Microsoft Corporation. All rights reserved.
  
    Nothing to do. None of the projects specified contain packages to restore.
  /usr/share/dotnet/sdk/2.1.500/Microsoft.Common.CurrentVersion.targets(1179,5): error MSB3644: The reference assemblies for framework ".NETFramework,Version=v4.7.2" were not found. To resolve this, install the SDK or Targeting Pack for this framework version or retarget your application to a version of the framework for which you have the SDK or Targeting Pack installed. Note that assemblies will be resolved from the Global Assembly Cache (GAC) and will be used in place of reference assemblies. Therefore your assembly may not be correctly targeted for the framework you intend. [/builds/test/TestProject.csproj]
  /usr/share/dotnet/sdk/2.1.500/Microsoft.Common.CurrentVersion.targets(1179,5): error MSB3644: The reference assemblies for framework ".NETFramework,Version=v4.7.2" were not found. To resolve this, install the SDK or Targeting Pack for this framework version or retarget your application to a version of the framework for which you have the SDK or Targeting Pack installed. Note that assemblies will be resolved from the Global Assembly Cache (GAC) and will be used in place of reference assemblies. Therefore your assembly may not be correctly targeted for the framework you intend. [/builds/test/TestProjectTests.csproj]
  
  Build FAILED.
  </code></pre>