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:ToolsNuget
uget.exe'
MSBUILD_PATH: 'C:Program Files (x86)Microsoft Visual Studio2017BuildToolsMSBuild15.0Binmsbuild.exe'
stages:
- build
- deploy
build_job:
stage: build
script:
- '& "$env:NUGET_PATH" restore'
- '& "$env:MSBUILD_PATH" /p:Configuration=Release /clp:ErrorsOnly'
- '& "$env:MSBUILD_PATH" myappmyapp.csproj /p:DeployOnBuild=true /p:Configuration=Release /P:PublishProfile=FolderProfile.pubxml'
artifacts:
expire_in: 2 days
paths:
- '.myappinReleasePublish'
deploy_job:
stage: deploy
only:
- master
script:
- 'xcopy /y /s ".myappinReleasePublish*.*" "C:inetpubwwwrootci-cd-example"'
dependencies:
- build_job
And getting the error in my build_job:
C:GitLab-Runneruilds4nvs5Z1P
ky_miest-projectpackagesMicrosoft.Net.Compilers.3.6.0oolsMicrosoft.Managed.Core.targets(60,27): error MSB4184: The expression ""App_StartRouteConfig.cs".GetPathsOfAllDirectoriesAbove()" cannot be evaluated. Method 'System.String.GetPathsOfAllDirectoriesAbove' not found.
[C:GitLab-Runneruilds4nvs5Z1P
ky_miest-projectmyappmyapp.csproj]
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…