简体   繁体   中英

Jenkins build error, visual studio 2010, MSbuild , System.IO.IOException process cannot access the file because it is used by another process

Can someone help in solving this error that i am getting while doing build.

7>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(151,5): error MSB4018: The "CustomBuild" task failed unexpectedly.

7>C:\\Program Files (x86)\\MSBuild\\Microsoft.Cpp\\v4.0\\Microsoft.CppCommon.targets(151,5): error MSB4018: System.IO.IOException: The process cannot access the file 'C:\\Users\\corrsha\\AppData\\Local\\Temp\\tmp6360215f89e24e42a21d91b81f09e212.cmd' because it is being used by another process. 7>C:\\Program Files (x86)\\MSBuild\\Microsoft.Cpp\\v4.0\\Microsoft.CppCommon.targets(151,5): error MSB4018: at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) 7>C:\\Program Files (x86)\\MSBuild\\Microsoft.Cpp\\v4.0\\Microsoft.CppCommon.targets(151,5): error MSB4018: at System.IO.File.InternalDelete(String path, Boolean checkHost) 7>C:\\Program Files (x86)\\MSBuild\\Microsoft.Cpp\\v4.0\\Microsoft.CppCommon.targets(151,5): error MSB4018: at System.IO.File.Delete(String path) 7>C:\\Program Files (x86)\\MSBuild\\Microsoft.Cpp\\v4.0\\Microsoft.CppCommon.targets(151,5): error MSB4018: at Microsoft.Build.Utilities.ToolTask.Execute() 7>C:\\Program Files (x86)\\MSBuild\\Microsoft.Cpp\\v4.0\\Microsoft.CppCommon.targets(151,5): error MSB4018: at Microsoft.Build.CPPTasks.TrackedVCToolTask.Execute() 7>C:\\Program Files (x86)\\MSBuild\\Microsoft.Cpp\\v4.0\\Microsoft.CppCommon.targets(151,5): error MSB4018: at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() 7>C:\\P rogram Files (x86)\\MSBuild\\Microsoft.Cpp\\v4.0\\Microsoft.CppCommon.targets(151,5): error MSB4018: at Microsoft.Build.BackEnd.TaskBuilder.d__26.MoveNext()

this is part of the jenkinsfile that i am using that is checked by the buildserver during the build `

    stage('clean workspace')

    stage('build')
    {
        bat '''
            call "C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\vcvarsall.bat" x86
        set REPO_VERSION=%BUILD_NUMBER%
            cd win32
            mkdir build
            cd build        
            "C:\\Program Files (x86)\\CMake\\bin\\cmake.exe" -G "Visual Studio 10 2010" -DCMAKE_INSTALL_PREFIX:PATH=D:/Jenkins_Workspace/UnifiedAutomationsdk_Test -DVERSION_PATCH=1 -DREPO_VERSION=%REPO_VERSION% -DSYSTEM_NAME=windows ..\\UaSdkCppBundleSource
            rem MSBuild INSTALL.vcxproj /p:Configuration=Debug 
            rem MSBuild PACKAGE.vcxproj /p:Configuration=Debug /verbosity:detailed
            MSBuild INSTALL.vcxproj /p:Configuration=Release
            MSBuild PACKAGE.vcxproj /p:Configuration=Release /verbosity:detailed
        '''`

It keeps throwing this error even if i try to build locally. But a colleague of mine tried from his system to build locally and the build succeeded. I am at a loss. Please help.

This file "C:\\Users\\SVC-jenkins-build\\AppData\\Local\\Temp\\tmp543d2674154c40a7943c76bcf0dce710.cmd" is beign used by some process and cannot be replaced. close/delete it manually. Also try to close and reopen VS.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM