{"action":"closed","issue":{"url":"https://api.github.com/repos/dotnet/cli/issues/2942","repository_url":"https://api.github.com/repos/dotnet/cli","labels_url":"https://api.github.com/repos/dotnet/cli/issues/2942/labels{/name}","comments_url":"https://api.github.com/repos/dotnet/cli/issues/2942/comments","events_url":"https://api.github.com/repos/dotnet/cli/issues/2942/events","html_url":"https://github.com/dotnet/cli/issues/2942","id":153565352,"number":2942,"title":"Incorrect message/behavior when publishing a project without restoring the project first ","user":{"login":"moozzyk","id":1438884,"avatar_url":"https://avatars.githubusercontent.com/u/1438884?v=3","gravatar_id":"","url":"https://api.github.com/users/moozzyk","html_url":"https://github.com/moozzyk","followers_url":"https://api.github.com/users/moozzyk/followers","following_url":"https://api.github.com/users/moozzyk/following{/other_user}","gists_url":"https://api.github.com/users/moozzyk/gists{/gist_id}","starred_url":"https://api.github.com/users/moozzyk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/moozzyk/subscriptions","organizations_url":"https://api.github.com/users/moozzyk/orgs","repos_url":"https://api.github.com/users/moozzyk/repos","events_url":"https://api.github.com/users/moozzyk/events{/privacy}","received_events_url":"https://api.github.com/users/moozzyk/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/dotnet/cli/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/dotnet/cli/labels/in%20progress","name":"in progress","color":"ededed"}],"state":"closed","locked":false,"assignee":{"login":"eerhardt","id":8291187,"avatar_url":"https://avatars.githubusercontent.com/u/8291187?v=3","gravatar_id":"","url":"https://api.github.com/users/eerhardt","html_url":"https://github.com/eerhardt","followers_url":"https://api.github.com/users/eerhardt/followers","following_url":"https://api.github.com/users/eerhardt/following{/other_user}","gists_url":"https://api.github.com/users/eerhardt/gists{/gist_id}","starred_url":"https://api.github.com/users/eerhardt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eerhardt/subscriptions","organizations_url":"https://api.github.com/users/eerhardt/orgs","repos_url":"https://api.github.com/users/eerhardt/repos","events_url":"https://api.github.com/users/eerhardt/events{/privacy}","received_events_url":"https://api.github.com/users/eerhardt/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/dotnet/cli/milestones/5","html_url":"https://github.com/dotnet/cli/milestones/1.0.0-rtm","labels_url":"https://api.github.com/repos/dotnet/cli/milestones/5/labels","id":1389772,"number":5,"title":"1.0.0-rtm","description":"2016 (https://github.com/aspnet/Home/wiki/Roadmap)","creator":{"login":"Petermarcu","id":8228359,"avatar_url":"https://avatars.githubusercontent.com/u/8228359?v=3","gravatar_id":"","url":"https://api.github.com/users/Petermarcu","html_url":"https://github.com/Petermarcu","followers_url":"https://api.github.com/users/Petermarcu/followers","following_url":"https://api.github.com/users/Petermarcu/following{/other_user}","gists_url":"https://api.github.com/users/Petermarcu/gists{/gist_id}","starred_url":"https://api.github.com/users/Petermarcu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Petermarcu/subscriptions","organizations_url":"https://api.github.com/users/Petermarcu/orgs","repos_url":"https://api.github.com/users/Petermarcu/repos","events_url":"https://api.github.com/users/Petermarcu/events{/privacy}","received_events_url":"https://api.github.com/users/Petermarcu/received_events","type":"User","site_admin":false},"open_issues":308,"closed_issues":138,"state":"open","created_at":"2015-11-02T19:50:04Z","updated_at":"2016-05-11T16:27:53Z","due_on":null,"closed_at":null},"comments":1,"created_at":"2016-05-07T01:24:57Z","updated_at":"2016-05-11T16:27:53Z","closed_at":"2016-05-11T16:27:53Z","body":"## Steps to reproduce\r\nTry publishing a project without restoring it first\r\n\r\n## Expected  behavior\r\nAn error saying that the project needs to be restored\r\n\r\n## Actual behavior\r\n```\r\nPS C:\\Source\\cli-samples\\HelloMvc> dotnet publish -f netcoreapp1.0\r\nCollection was modified; enumeration operation may not execute.\r\nPS C:\\Source\\cli-samples\\HelloMvc> dotnet -v publish -f netcoreapp1.0\r\nTelemetry is: Enabled\r\nCollection was modified; enumeration operation may not execute.\r\nSystem.InvalidOperationException: Collection was modified; enumeration operation may not execute.\r\n   at System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource)\r\n   at System.Collections.Generic.List`1.Enumerator.MoveNextRare()\r\n   at System.Linq.Enumerable.WhereSelectListIterator`2.MoveNext()\r\n   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)\r\n   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)\r\n   at Microsoft.DotNet.Tools.Publish.PublishCommand.TryPrepareForPublish()\r\n   at Microsoft.DotNet.Tools.Publish.PublishCommand.<>c__DisplayClass0_0.<Run>b__0()\r\n   at Microsoft.DotNet.Cli.CommandLine.CommandLineApplication.Execute(String[] args)\r\n   at Microsoft.DotNet.Tools.Publish.PublishCommand.Run(String[] args)\r\n```\r\n\r\n## Environment data\r\n`dotnet --info` output:\r\n\r\n```\r\nPS C:\\Source\\cli-samples\\HelloWeb> dotnet --info\r\n.NET Command Line Tools (1.0.0-rc2-002670)\r\n\r\nProduct Information:\r\n Version:     1.0.0-rc2-002670\r\n Commit Sha:  f0018642a9\r\n\r\nRuntime Environment:\r\n OS Name:     Windows\r\n OS Version:  10.0.10586\r\n OS Platform: Windows\r\n RID:         win10-x64\r\n```\r\n\r\n\r\n\r\n\r\n\r\n"}}