GitLab Runner purges build results

Hello everyone.
I’m getting really frustrated with my deployment pipeline and this is pretty much my last resort. I hope someone has a clue why this is happening.

My problem is that after the GitLab runner has finished building my .NET solution and all its project files, all build results (dlls and NuGet packages) are missing for some reason. And this happens BEFORE any other stage or even before the current stage is finished.
When I run the exact same sequence locally, everything works and all files are present.

My .gitlab-ci.yml file:

stages:
- build
- publish

build:
stage: build
only:
    - development
    - master
    - tags
script:
    - 'echo Restoring NuGet packages...'
    - 'nuget restore'
    - 'echo Building solution (Release build)...'
    - 'dotnet build /p:Configuration="Release";Platform="Any CPU" /t:Clean;Build'
    #<-- file are already missing here! any usage results in file not found
artifacts:
    expire_in: 1h
    paths:
        - 'bin\Release'

publish:
    stage: publish
    script:
        - 'echo Moving NuGet builds to publish folder...'
        - 'xcopy "%CORE_PATH%" "%PUBLISH_PATH%\latest"'
        - 'xcopy "%UI_PATH%" "%PUBLISH_PATH%\latest"'
        - 'xcopy "%WINFORMS_PATH%" "%PUBLISH_PATH%\latest"'
    dependencies:
        - build

Project structure is as follows:

  • bin
    • Release
      • Project.Core
        • net46
          • Project.Core.dll
        • netcoreapp2.0
          • Project.Core.dll
        • netstandard2.0
          • Project.Core.dll
        • Project.Core.x.x.x.nupkg
      • Project.UI (similar to Project.Core)
      • Project.WinForms (similar to Project.Core)
  • doc
    • Project.Core.xml
    • Project.UI.xml
    • Project.WinForms.xml
  • Project.Core
    • Project.Core.csproj
  • Project.UI
    • Project.UI.csproj
  • Project.WinForms
    • Project.WinForms.csproj
  • Solution.sln

All project files are set to built into the bin folder at the solution root (with relative paths) and also generate a NuGet package. All builds succeed but whenever I try to find/use any of the compiled files right after they were build I get an exception.

Does anybody have a solution/explanation for this behavior?
Any help is much appreciated. Thanks.

Using dotnet msbuild instead of dotnet build did the trick. I have no idea why though.