Search code examples
azure-pipelinestfsbuild

Access denied error in Build definition. Build is successfull when server restarted


[error]Access to the path 'C:\agent_work\2\s\drop\Release_2015' is denied.

IF I delete the agent folder '2' and restart the server then the build works fine. Again the later Builds ended up with this error message.

Could not find the cause. Any help would be good. Thank you.


Solution

  • You may try the following items:

    1. Set the Clean option to Truein the build definition.
    2. If you use MSBuild to build your poject, add parameter /m:1 to use only one processor.

    https://learn.microsoft.com/en-us/visualstudio/msbuild/building-multiple-projects-in-parallel-with-msbuild?view=vs-2019