{"action":"closed","issue":{"url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/issues/614","repository_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks","labels_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/issues/614/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/issues/614/comments","events_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/issues/614/events","html_url":"https://github.com/Microsoft/vso-agent-tasks/issues/614","id":109585501,"number":614,"title":"Build.StagingDirectory and Build.ArtifactsStagingDirectory are the same directory","user":{"login":"zooba","id":1693688,"avatar_url":"https://avatars.githubusercontent.com/u/1693688?v=3","gravatar_id":"","url":"https://api.github.com/users/zooba","html_url":"https://github.com/zooba","followers_url":"https://api.github.com/users/zooba/followers","following_url":"https://api.github.com/users/zooba/following{/other_user}","gists_url":"https://api.github.com/users/zooba/gists{/gist_id}","starred_url":"https://api.github.com/users/zooba/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zooba/subscriptions","organizations_url":"https://api.github.com/users/zooba/orgs","repos_url":"https://api.github.com/users/zooba/repos","events_url":"https://api.github.com/users/zooba/events{/privacy}","received_events_url":"https://api.github.com/users/zooba/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":{"login":"TingluoHuang","id":1750815,"avatar_url":"https://avatars.githubusercontent.com/u/1750815?v=3","gravatar_id":"","url":"https://api.github.com/users/TingluoHuang","html_url":"https://github.com/TingluoHuang","followers_url":"https://api.github.com/users/TingluoHuang/followers","following_url":"https://api.github.com/users/TingluoHuang/following{/other_user}","gists_url":"https://api.github.com/users/TingluoHuang/gists{/gist_id}","starred_url":"https://api.github.com/users/TingluoHuang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TingluoHuang/subscriptions","organizations_url":"https://api.github.com/users/TingluoHuang/orgs","repos_url":"https://api.github.com/users/TingluoHuang/repos","events_url":"https://api.github.com/users/TingluoHuang/events{/privacy}","received_events_url":"https://api.github.com/users/TingluoHuang/received_events","type":"User","site_admin":false},"milestone":null,"comments":14,"created_at":"2015-10-02T22:53:11Z","updated_at":"2016-03-30T05:16:31Z","closed_at":"2016-03-30T05:16:30Z","body":"When I run my build with the PublishBuildArtifacts 1.0.4 task, I get errors like:\r\n\r\n```\r\nExecuting the powershell script: C:\\VSOAgent\\tasks\\PublishBuildArtifacts\\1.0.4\\PublishBuildArtifacts.ps1\r\nPreparing artifact content in staging folder C:\\VSOAgent\\_work\\1\\a...\r\nCopying all files from C:\\VSOAgent\\_work\\1\\a\\layout\\Microsoft.PythonTools to C:\\VSOAgent\\_work\\1\\a\\layout\\Microsoft.PythonTools\r\nThe process cannot access the file 'C:\\VSOAgent\\_work\\1\\a\\layout\\Microsoft.PythonTools\\BuiltinScraper.py' because it is being used by another process.\r\n```\r\n\r\nPreviously, the task would prepare artifacts in a staging folder that was different from `Build.StagingDirectory`, which [the docs](https://msdn.microsoft.com/Library/vs/alm/Build/scripts/variables) suggest using for temporary build artifacts.\r\n\r\nI've worked around it by inserting an extra directory level into my build outputs, so they don't conflict with where PublishBuildArtifacts tries to copy them, but ISTM that `Build.StagingDirectory` and `Build.ArtifactsStagingDirectory` should refer to different folders."}}