{"action":"created","issue":{"url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/issues/745","labels_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/issues/745/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/issues/745/comments","events_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/issues/745/events","html_url":"https://github.com/Microsoft/vso-agent-tasks/issues/745","id":115415327,"number":745,"title":"NuGet Publisher does not work when running within a Release Definition","user":{"login":"FunnyFry","id":14067107,"avatar_url":"https://avatars.githubusercontent.com/u/14067107?v=3","gravatar_id":"","url":"https://api.github.com/users/FunnyFry","html_url":"https://github.com/FunnyFry","followers_url":"https://api.github.com/users/FunnyFry/followers","following_url":"https://api.github.com/users/FunnyFry/following{/other_user}","gists_url":"https://api.github.com/users/FunnyFry/gists{/gist_id}","starred_url":"https://api.github.com/users/FunnyFry/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FunnyFry/subscriptions","organizations_url":"https://api.github.com/users/FunnyFry/orgs","repos_url":"https://api.github.com/users/FunnyFry/repos","events_url":"https://api.github.com/users/FunnyFry/events{/privacy}","received_events_url":"https://api.github.com/users/FunnyFry/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"vtbassmatt","id":714283,"avatar_url":"https://avatars.githubusercontent.com/u/714283?v=3","gravatar_id":"","url":"https://api.github.com/users/vtbassmatt","html_url":"https://github.com/vtbassmatt","followers_url":"https://api.github.com/users/vtbassmatt/followers","following_url":"https://api.github.com/users/vtbassmatt/following{/other_user}","gists_url":"https://api.github.com/users/vtbassmatt/gists{/gist_id}","starred_url":"https://api.github.com/users/vtbassmatt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vtbassmatt/subscriptions","organizations_url":"https://api.github.com/users/vtbassmatt/orgs","repos_url":"https://api.github.com/users/vtbassmatt/repos","events_url":"https://api.github.com/users/vtbassmatt/events{/privacy}","received_events_url":"https://api.github.com/users/vtbassmatt/received_events","type":"User","site_admin":false},"milestone":null,"comments":3,"created_at":"2015-11-06T01:31:49Z","updated_at":"2016-01-04T22:22:42Z","closed_at":null,"body":"In the **NuGet Publisher** task, the *VsoNuGetHelper.ps1* file intends to use the current build/release working directory to save a temporary NuGet.Config file as shown below.\r\n\r\n```$nuGetTempDirectory = Join-Path $Env:AGENT_BUILDDIRECTORY \"NuGet\\\"```\r\n\r\nHowever, within a Release Definition, the environment variable ```AGENT_BUILDDIRECTORY``` is not defined and ```AGENT_RELEASEDIRECTORY``` should be used.\r\n\r\nOne way this could be written is below:\r\n```\r\n$baseDirectory = $Env:AGENT_BUILDDIRECTORY\r\nif($baseDirectory -eq $null)\r\n{\r\n    $baseDirectory = $Env:AGENT_RELEASEDIRECTORY\r\n}\r\n\r\n$nuGetTempDirectory = Join-Path $baseDirectory \"NuGet\\\"\r\n```"},"comment":{"url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/issues/comments/168829765","html_url":"https://github.com/Microsoft/vso-agent-tasks/issues/745#issuecomment-168829765","issue_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/issues/745","id":168829765,"user":{"login":"vtbassmatt","id":714283,"avatar_url":"https://avatars.githubusercontent.com/u/714283?v=3","gravatar_id":"","url":"https://api.github.com/users/vtbassmatt","html_url":"https://github.com/vtbassmatt","followers_url":"https://api.github.com/users/vtbassmatt/followers","following_url":"https://api.github.com/users/vtbassmatt/following{/other_user}","gists_url":"https://api.github.com/users/vtbassmatt/gists{/gist_id}","starred_url":"https://api.github.com/users/vtbassmatt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vtbassmatt/subscriptions","organizations_url":"https://api.github.com/users/vtbassmatt/orgs","repos_url":"https://api.github.com/users/vtbassmatt/repos","events_url":"https://api.github.com/users/vtbassmatt/events{/privacy}","received_events_url":"https://api.github.com/users/vtbassmatt/received_events","type":"User","site_admin":false},"created_at":"2016-01-04T22:22:42Z","updated_at":"2016-01-04T22:22:42Z","body":"Thanks @omeshp - we'll do what you proposed."}}