{"action":"created","issue":{"url":"https://api.github.com/repos/TAGC/dotnet-setversion/issues/5","repository_url":"https://api.github.com/repos/TAGC/dotnet-setversion","labels_url":"https://api.github.com/repos/TAGC/dotnet-setversion/issues/5/labels{/name}","comments_url":"https://api.github.com/repos/TAGC/dotnet-setversion/issues/5/comments","events_url":"https://api.github.com/repos/TAGC/dotnet-setversion/issues/5/events","html_url":"https://github.com/TAGC/dotnet-setversion/issues/5","id":284480789,"number":5,"title":"Add support for the VSTS dotnet build task","user":{"login":"roryprimrose","id":2044291,"avatar_url":"https://avatars1.githubusercontent.com/u/2044291?v=4","gravatar_id":"","url":"https://api.github.com/users/roryprimrose","html_url":"https://github.com/roryprimrose","followers_url":"https://api.github.com/users/roryprimrose/followers","following_url":"https://api.github.com/users/roryprimrose/following{/other_user}","gists_url":"https://api.github.com/users/roryprimrose/gists{/gist_id}","starred_url":"https://api.github.com/users/roryprimrose/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/roryprimrose/subscriptions","organizations_url":"https://api.github.com/users/roryprimrose/orgs","repos_url":"https://api.github.com/users/roryprimrose/repos","events_url":"https://api.github.com/users/roryprimrose/events{/privacy}","received_events_url":"https://api.github.com/users/roryprimrose/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-12-26T02:08:08Z","updated_at":"2017-12-26T11:45:27Z","closed_at":null,"author_association":"NONE","body":"Thanks for writing this CLI. I've been trying to find a good solution to this for a very long time.\r\n\r\nThe VSTS dotnet build task (v2 preview) supports a custom command that could be used to execute setversion. \r\n\r\n![image](https://user-images.githubusercontent.com/2044291/34344786-7da074e8-ea3d-11e7-9977-762f39558e29.png)\r\n\r\nThe issue is that the setversion CLI looks for a csproj in the current directory which does not support the way that VSTS execute dotnet in a build.\r\n\r\nThe VSTS dotnet build task will identify one or more projects using the glob **/*.csproj. It then passes this as the second parameter to the dotnet CLI. For example:\r\n\r\n```\r\n\"C:\\Program Files\\dotnet\\dotnet.exe\" setversion C:\\B\\_work\\4\\s\\MySolution\\MyProject.csproj 0.1.0-hostfixes0005\r\n```\r\n\r\nThe only way I've been able to dotnet-setversion to work with the current implementation is to use a command line step that executes with the current directory set to the project folder and then call\r\n\r\n```\r\ndotnet setversion 0.1.0-hostfixes0005\r\n```\r\n\r\nThe main disadvantage here is that this would require build multiple steps and hard-coded references to project folders to support multiple projects. The build definition then needs to be updated to add more build steps as projects are added to the solution.\r\n\r\nOne way to solve this would be to identify an absolute path to a csproj in one of the command line parameters and then find the version from one of the other parameters. If no csproj path is specified then the fallback would use what the current implementation does."},"comment":{"url":"https://api.github.com/repos/TAGC/dotnet-setversion/issues/comments/353959508","html_url":"https://github.com/TAGC/dotnet-setversion/issues/5#issuecomment-353959508","issue_url":"https://api.github.com/repos/TAGC/dotnet-setversion/issues/5","id":353959508,"user":{"login":"TAGC","id":1588951,"avatar_url":"https://avatars2.githubusercontent.com/u/1588951?v=4","gravatar_id":"","url":"https://api.github.com/users/TAGC","html_url":"https://github.com/TAGC","followers_url":"https://api.github.com/users/TAGC/followers","following_url":"https://api.github.com/users/TAGC/following{/other_user}","gists_url":"https://api.github.com/users/TAGC/gists{/gist_id}","starred_url":"https://api.github.com/users/TAGC/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TAGC/subscriptions","organizations_url":"https://api.github.com/users/TAGC/orgs","repos_url":"https://api.github.com/users/TAGC/repos","events_url":"https://api.github.com/users/TAGC/events{/privacy}","received_events_url":"https://api.github.com/users/TAGC/received_events","type":"User","site_admin":false},"created_at":"2017-12-26T11:45:27Z","updated_at":"2017-12-26T11:45:27Z","author_association":"OWNER","body":"Hey @roryprimrose.\r\n\r\nI started work on this request but I just remembered - you necessarily have to have the project directory as the current working directory in order to call \"dotnet setversion\". This is the case with all dotnet CLI tools. If you try to call from another directory, you get `No executable found matching command \"dotnet-setversion\"`."}}
{"actor":{"display_login":"TAGC"}}