It would be great if someone can help me to fix the randomly seeing error in VSTS Build agents:
MSBUILD : Logger error MSB4104: Failed to write to log file XYZ.sln.log. . The process cannot access the file XYZ.sln.log because it is being used by another process. ##[error]Process msbuild.exe exited with code 1.
Restarted the agent, configured windows machine...
MSBUILD : Logger error MSB4104: Failed to write to log file “XYZ.sln.log”
First, if the log file is not needed for you, on the Azure Devops, uncheck "Create Log File" in the "Advanced" section of each MSBuild task or Visual Studio task:
But, if you need that log file or the Create Log File checkbox is unchecked, check if the current user have the write permission to that log file folder.
If above not help to resolve this issue, please set system.debug as true in build definition and queue a new build, then provide complete build logs and the definition about the build task for us.
Hope this helps.
If you have "Create Log File" not selected already and you are still getting this issue, try below steps:
For us it was system.debug = true causing this exceptions.
Admittedly I also came to know about it from below link
https://developercommunity.visualstudio.com/content/problem/561551/visual-studio-build-11510-the-process-cannot-acces.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With