{"action":"created","issue":{"url":"https://api.github.com/repos/dotnet/roslyn/issues/21754","repository_url":"https://api.github.com/repos/dotnet/roslyn","labels_url":"https://api.github.com/repos/dotnet/roslyn/issues/21754/labels{/name}","comments_url":"https://api.github.com/repos/dotnet/roslyn/issues/21754/comments","events_url":"https://api.github.com/repos/dotnet/roslyn/issues/21754/events","html_url":"https://github.com/dotnet/roslyn/issues/21754","id":253058810,"number":21754,"title":"Restore.cmd: exception thrown when trying to run in some cases.","user":{"login":"dezsiszabi","id":6433293,"avatar_url":"https://avatars1.githubusercontent.com/u/6433293?v=4","gravatar_id":"","url":"https://api.github.com/users/dezsiszabi","html_url":"https://github.com/dezsiszabi","followers_url":"https://api.github.com/users/dezsiszabi/followers","following_url":"https://api.github.com/users/dezsiszabi/following{/other_user}","gists_url":"https://api.github.com/users/dezsiszabi/gists{/gist_id}","starred_url":"https://api.github.com/users/dezsiszabi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dezsiszabi/subscriptions","organizations_url":"https://api.github.com/users/dezsiszabi/orgs","repos_url":"https://api.github.com/users/dezsiszabi/repos","events_url":"https://api.github.com/users/dezsiszabi/events{/privacy}","received_events_url":"https://api.github.com/users/dezsiszabi/received_events","type":"User","site_admin":false},"labels":[{"id":166680296,"url":"https://api.github.com/repos/dotnet/roslyn/labels/Area-Infrastructure","name":"Area-Infrastructure","color":"5319e7","default":false},{"id":273669338,"url":"https://api.github.com/repos/dotnet/roslyn/labels/Contributor%20Pain","name":"Contributor Pain","color":"e11d21","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2017-08-26T03:39:38Z","updated_at":"2017-09-15T05:12:49Z","closed_at":null,"author_association":"NONE","body":"**Version Used**: \r\nLatest version from master.\r\n\r\n**Steps to Reproduce**:\r\n\r\n1. Open a cmd.exe and navigate to Restore.cmd. Make sure it's not a developer command prompt and you don't have the VSINSTALLDIR environment variable set.\r\n2. Go to your NuGet packages folder and delete the vswhere package. I had two folders: vswhere and vswhere.1.0.71. It's usually under %USERPROFILE%\\\\.nuget\\packages\r\n3. Run Restore.cmd\r\n\r\n**Expected Behavior**:\r\nShould download vswhere and move on with the NuGet restore process.\r\n\r\n**Actual Behavior**:\r\nYou get the below output:\r\n\r\n```\r\nh:\\Practice\\GitHub\\roslyn>Restore.cmd\r\nRepo Dir H:\\Practice\\GitHub\\roslyn\r\nBinaries Dir H:\\Practice\\GitHub\\roslyn\\Binaries\r\nUsing existing NuGet.exe at version 4.1.0\r\nIllegal characters in path.\r\nUsing existing NuGet.exe at version 4.1.0\r\nIllegal characters in path.\r\nCommand failed to execute:  & $nuget install $name -OutputDirectory (Get-PackagesDir) -Version $version\r\nSystem.Management.Automation.RuntimeException: Command failed to execute:  & $nuget install $name -OutputDirectory (Get-PackagesDir) -Version $version\r\nat Exec-Block, H:\\Practice\\GitHub\\roslyn\\build\\scripts\\build-utils.ps1: line 26\r\nat Ensure-BasicTool, H:\\Practice\\GitHub\\roslyn\\build\\scripts\\build-utils.ps1: line 128\r\nat Get-MSBuildDirXCopy, H:\\Practice\\GitHub\\roslyn\\build\\scripts\\build-utils.ps1: line 264\r\nat Get-MSBuildKindAndDir, H:\\Practice\\GitHub\\roslyn\\build\\scripts\\build-utils.ps1: line 258\r\nat Ensure-MSBuild, H:\\Practice\\GitHub\\roslyn\\build\\scripts\\build-utils.ps1: line 137\r\nat Ensure-MSBuildAndDir, H:\\Practice\\GitHub\\roslyn\\build\\scripts\\build-utils.ps1: line 157\r\nat <ScriptBlock>, H:\\Practice\\GitHub\\roslyn\\build\\scripts\\build.ps1: line 512\r\n```\r\n\r\n**Reason**\r\nAs far as I know NuGet doesn't support a trailing '\\\\' in its `OutputDirectory` parameter*.\r\nThe `Get-PackagesDir` function is used to calculate what's passed to NuGet as an argument.\r\n\r\n**Solution**\r\nI have a solution which I can submit as a PR once you confirm this issue.\r\nAdding `.TrimEnd(\"\\\")` in `Ensure-BasicTool` to what's passed to NuGet solves this. The reason I don't propose changing this in `Get-PackagesDir` is because that's called from multiple places and could break other things if something else expects the trailing '\\\\' to be there.\r\n\r\n*Source: \r\nhttps://github.com/NuGet/home/issues/1817\r\nhttps://github.com/NuGet/NuGet.Client/commit/f47b115f2577fa0304d5b595ac86ef2d4cfab605"},"comment":{"url":"https://api.github.com/repos/dotnet/roslyn/issues/comments/329683278","html_url":"https://github.com/dotnet/roslyn/issues/21754#issuecomment-329683278","issue_url":"https://api.github.com/repos/dotnet/roslyn/issues/21754","id":329683278,"user":{"login":"jasonmalinowski","id":201340,"avatar_url":"https://avatars3.githubusercontent.com/u/201340?v=4","gravatar_id":"","url":"https://api.github.com/users/jasonmalinowski","html_url":"https://github.com/jasonmalinowski","followers_url":"https://api.github.com/users/jasonmalinowski/followers","following_url":"https://api.github.com/users/jasonmalinowski/following{/other_user}","gists_url":"https://api.github.com/users/jasonmalinowski/gists{/gist_id}","starred_url":"https://api.github.com/users/jasonmalinowski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jasonmalinowski/subscriptions","organizations_url":"https://api.github.com/users/jasonmalinowski/orgs","repos_url":"https://api.github.com/users/jasonmalinowski/repos","events_url":"https://api.github.com/users/jasonmalinowski/events{/privacy}","received_events_url":"https://api.github.com/users/jasonmalinowski/received_events","type":"User","site_admin":false},"created_at":"2017-09-15T05:12:49Z","updated_at":"2017-09-15T05:12:49Z","author_association":"MEMBER","body":"@dezsiszabi Of course! Go right ahead. :-)"}}
{"actor":{"display_login":"jasonmalinowski"}}