error MSB4184: The expression ""App_Start\RouteConfig.cs".GetPathsOfAllDirectoriesAbove()" cannot be evaluated. (while in Gitlab runner)

Viewed 675

I was trying to perform CI/CD using Gitlab runner for a .NET Framework project.
This is my .gitlab-ci.yml file:

variables:
  NUGET_PATH: 'C:\Tools\Nuget\nuget.exe'
  MSBUILD_PATH: 'C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\msbuild.exe'

stages:
  - build
  - deploy

build_job:
  stage: build
  script:
    - '& "$env:NUGET_PATH" restore'
    - '& "$env:MSBUILD_PATH" /p:Configuration=Release /clp:ErrorsOnly'
    - '& "$env:MSBUILD_PATH" myapp\myapp.csproj /p:DeployOnBuild=true /p:Configuration=Release /P:PublishProfile=FolderProfile.pubxml'
  artifacts:
    expire_in: 2 days
    paths:
      - '.\myapp\bin\Release\Publish\'



deploy_job:
  stage: deploy
  only:
    - master
  script:
    - 'xcopy /y /s ".\myapp\bin\Release\Publish\*.*" "C:\inetpub\wwwroot\ci-cd-example"'

  dependencies:
    - build_job

And getting the error in my build_job:

C:\GitLab-Runner\builds\4nvs5Z1P\0\rky_mi\test-project\packages\Microsoft.Net.Compilers.3.6.0\tools\Microsoft.Managed.Core.targets(60,27): error MSB4184: The expression ""App_Start\RouteConfig.cs".GetPathsOfAllDirectoriesAbove()" cannot be evaluated. Method 'System.String.GetPathsOfAllDirectoriesAbove' not found. 
[C:\GitLab-Runner\builds\4nvs5Z1P\0\rky_mi\test-project\myapp\myapp.csproj]
0 Answers
Related