Teamcity can't delete file because the previous build lock does file

 

I have a build with msbuild that look to sometime lock some file of the Microsoft.Net.Compilers.Toolset nuget package.

I have look at the process and i think the file can't be deleted because after the build the compiler.exe is still in memory et running.

So, on the next run teamcity can't delete the file.

What I could do to prevent this problem from happening?

Rigth now I kill the compiler process and delete the folder manually. Before I was restarting the teamcity agent.

Clean build enabled: removing old files from C:\BuildAgent\work\7caf63d1429202af

[17:44:03]Failed to delete file: C:\BuildAgent\work\7caf63d1429202af\src\packages\Microsoft.Net.Compilers.Toolset.4.1.0\tasks\net472\Microsoft.CodeAnalysis.CSharp.dll
[17:44:03]Failed to delete file: C:\BuildAgent\work\7caf63d1429202af\src\packages\Microsoft.Net.Compilers.Toolset.4.1.0\tasks\net472\Microsoft.CodeAnalysis.VisualBasic.dll
 
[17:44:03]Failed to delete file: C:\BuildAgent\work\7caf63d1429202af\src\packages\Microsoft.Net.Compilers.Toolset.4.1.0\tasks\net472\Microsoft.CodeAnalysis.dll
[17:44:03]Failed to delete file: C:\BuildAgent\work\7caf63d1429202af\src\packages\Microsoft.Net.Compilers.Toolset.4.1.0\tasks\net472\Microsoft.DiaSymReader.Native.amd64.dll
[17:44:03]Failed to delete file: C:\BuildAgent\work\7caf63d1429202af\src\packages\Microsoft.Net.Compilers.Toolset.4.1.0\tasks\net472\System.Buffers.dll
[17:44:03]Failed to delete file: C:\BuildAgent\work\7caf63d1429202af\src\packages\Microsoft.Net.Compilers.Toolset.4.1.0\tasks\net472\VBCSCompiler.exe
0

Please sign in to leave a comment.