{"action":"reopened","issue":{"url":"https://api.github.com/repos/dotnet/cli/issues/3736","repository_url":"https://api.github.com/repos/dotnet/cli","labels_url":"https://api.github.com/repos/dotnet/cli/issues/3736/labels{/name}","comments_url":"https://api.github.com/repos/dotnet/cli/issues/3736/comments","events_url":"https://api.github.com/repos/dotnet/cli/issues/3736/events","html_url":"https://github.com/dotnet/cli/issues/3736","id":163057624,"number":3736,"title":"UX improvement: dotnet CLI should automatically restore when necessary","user":{"login":"benjamincburns","id":803016,"avatar_url":"https://avatars.githubusercontent.com/u/803016?v=3","gravatar_id":"","url":"https://api.github.com/users/benjamincburns","html_url":"https://github.com/benjamincburns","followers_url":"https://api.github.com/users/benjamincburns/followers","following_url":"https://api.github.com/users/benjamincburns/following{/other_user}","gists_url":"https://api.github.com/users/benjamincburns/gists{/gist_id}","starred_url":"https://api.github.com/users/benjamincburns/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benjamincburns/subscriptions","organizations_url":"https://api.github.com/users/benjamincburns/orgs","repos_url":"https://api.github.com/users/benjamincburns/repos","events_url":"https://api.github.com/users/benjamincburns/events{/privacy}","received_events_url":"https://api.github.com/users/benjamincburns/received_events","type":"User","site_admin":false},"labels":[{"id":268110642,"url":"https://api.github.com/repos/dotnet/cli/labels/bug","name":"bug","color":"fc2929","default":true}],"state":"open","locked":false,"assignee":{"login":"livarcocc","id":367554,"avatar_url":"https://avatars.githubusercontent.com/u/367554?v=3","gravatar_id":"","url":"https://api.github.com/users/livarcocc","html_url":"https://github.com/livarcocc","followers_url":"https://api.github.com/users/livarcocc/followers","following_url":"https://api.github.com/users/livarcocc/following{/other_user}","gists_url":"https://api.github.com/users/livarcocc/gists{/gist_id}","starred_url":"https://api.github.com/users/livarcocc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/livarcocc/subscriptions","organizations_url":"https://api.github.com/users/livarcocc/orgs","repos_url":"https://api.github.com/users/livarcocc/repos","events_url":"https://api.github.com/users/livarcocc/events{/privacy}","received_events_url":"https://api.github.com/users/livarcocc/received_events","type":"User","site_admin":false},"assignees":[{"login":"livarcocc","id":367554,"avatar_url":"https://avatars.githubusercontent.com/u/367554?v=3","gravatar_id":"","url":"https://api.github.com/users/livarcocc","html_url":"https://github.com/livarcocc","followers_url":"https://api.github.com/users/livarcocc/followers","following_url":"https://api.github.com/users/livarcocc/following{/other_user}","gists_url":"https://api.github.com/users/livarcocc/gists{/gist_id}","starred_url":"https://api.github.com/users/livarcocc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/livarcocc/subscriptions","organizations_url":"https://api.github.com/users/livarcocc/orgs","repos_url":"https://api.github.com/users/livarcocc/repos","events_url":"https://api.github.com/users/livarcocc/events{/privacy}","received_events_url":"https://api.github.com/users/livarcocc/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/dotnet/cli/milestones/15","html_url":"https://github.com/dotnet/cli/milestone/15","labels_url":"https://api.github.com/repos/dotnet/cli/milestones/15/labels","id":2177852,"number":15,"title":"1.0.0-preview5","description":"","creator":{"login":"piotrpMSFT","id":2379589,"avatar_url":"https://avatars.githubusercontent.com/u/2379589?v=3","gravatar_id":"","url":"https://api.github.com/users/piotrpMSFT","html_url":"https://github.com/piotrpMSFT","followers_url":"https://api.github.com/users/piotrpMSFT/followers","following_url":"https://api.github.com/users/piotrpMSFT/following{/other_user}","gists_url":"https://api.github.com/users/piotrpMSFT/gists{/gist_id}","starred_url":"https://api.github.com/users/piotrpMSFT/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/piotrpMSFT/subscriptions","organizations_url":"https://api.github.com/users/piotrpMSFT/orgs","repos_url":"https://api.github.com/users/piotrpMSFT/repos","events_url":"https://api.github.com/users/piotrpMSFT/events{/privacy}","received_events_url":"https://api.github.com/users/piotrpMSFT/received_events","type":"User","site_admin":false},"open_issues":55,"closed_issues":26,"state":"open","created_at":"2016-12-06T02:14:52Z","updated_at":"2016-12-20T21:58:36Z","due_on":null,"closed_at":null},"comments":8,"created_at":"2016-06-30T00:35:53Z","updated_at":"2016-12-20T21:58:36Z","closed_at":null,"body":"Error messages which instruct the user to carry out some action can generally be replaced with the action itself. In this case, the error `NU1009: The expected lock file doesn't exist. Please run \"dotnet restore\" to generate a new lock file` and other similar warnings/errors are annoying and it seems they should be replaced with an automatic run of `dotnet restore.`\r\n## Steps to reproduce\r\n\r\n```\r\ndotnet new\r\ndotnet run\r\n```\r\n## Expected  behavior\r\n\r\nThe `dotnet` cli recognizes that `project.lock.json` is missing or out of date and automatically runs `dotnet restore` without prompting the user to do it.\r\n\r\n```bburns@workstation:~/projects/dotnettest$ dotnet run\r\nlog  : The expected lock file doesn't exist. Automatically restoring packages to recreate it.\r\nlog  : Restoring packages for /home/bburns/projects/dotnettest/project.json...\r\nlog  : Writing lock file to disk. Path: /home/bburns/projects/dotnettest/project.lock.json\r\nlog  : /home/bburns/projects/dotnettest/project.json\r\nlog  : Restore completed in 709ms.\r\nProject dotnettest (.NETCoreApp,Version=v1.0) will be compiled because expected outputs are missing\r\nCompiling dotnettest for .NETCoreApp,Version=v1.0\r\n\r\nCompilation succeeded.\r\n    0 Warning(s)\r\n    0 Error(s)\r\n\r\nTime elapsed 00:00:00.8663525\r\n\r\nHello World!\r\n\r\n```\r\n\r\n## Actual behavior\r\n```\r\n\r\nbburns@workstation:~/projects/dotnettest$ dotnet run\r\nThe current project is not valid because of the following errors:\r\n/home/bburns/projects/dotnettest/project.lock.json(1,0): error NU1009: The expected lock file doesn't exist. Please run \"dotnet restore\" to generate a new lock file.\r\n\r\n```\r\n\r\n## Environment data\r\n`dotnet --info` output:\r\n\r\n.NET Command Line Tools (1.0.0-preview2-003121)\r\n\r\nProduct Information:\r\n Version:            1.0.0-preview2-003121\r\n Commit SHA-1 hash:  1e9d529bc5\r\n\r\nRuntime Environment:\r\n OS Name:     ubuntu\r\n OS Version:  16.04\r\n OS Platform: Linux\r\n RID:         ubuntu.16.04-x64\r\n\r\n\r\n```\r\n"}}
{"actor":{"display_login":"livarcocc"}}