{"action":"created","issue":{"url":"https://api.github.com/repos/dotnet/cli/issues/4786","repository_url":"https://api.github.com/repos/dotnet/cli","labels_url":"https://api.github.com/repos/dotnet/cli/issues/4786/labels{/name}","comments_url":"https://api.github.com/repos/dotnet/cli/issues/4786/comments","events_url":"https://api.github.com/repos/dotnet/cli/issues/4786/events","html_url":"https://github.com/dotnet/cli/issues/4786","id":190522002,"number":4786,"title":"Builds of solutions with multiple inter-dependent .NET Core projects frequently fail with CS2012 \"Cannot open\" file errors","user":{"login":"frankbuckley","id":5655810,"avatar_url":"https://avatars.githubusercontent.com/u/5655810?v=3","gravatar_id":"","url":"https://api.github.com/users/frankbuckley","html_url":"https://github.com/frankbuckley","followers_url":"https://api.github.com/users/frankbuckley/followers","following_url":"https://api.github.com/users/frankbuckley/following{/other_user}","gists_url":"https://api.github.com/users/frankbuckley/gists{/gist_id}","starred_url":"https://api.github.com/users/frankbuckley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/frankbuckley/subscriptions","organizations_url":"https://api.github.com/users/frankbuckley/orgs","repos_url":"https://api.github.com/users/frankbuckley/repos","events_url":"https://api.github.com/users/frankbuckley/events{/privacy}","received_events_url":"https://api.github.com/users/frankbuckley/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-11-19T21:37:23Z","updated_at":"2016-11-19T23:08:59Z","closed_at":null,"body":"## Steps to reproduce\r\n\r\nWith a solution with multiple .NET Core projects with many sharing project dependencies:\r\n\r\n- dotnet restore\r\n- dotnet build\r\n\r\n## Expected  behavior\r\n\r\nSolution builds.\r\n\r\n## Actual behavior\r\n\r\nSolution sometimes builds, but also often fails with errors similar to:\r\n\r\n`CSC : error CS2012: Cannot open 'C:\\a\\w\\1\\s\\src\\Project\\obj\\Debug\\netstandard1.4\\Project.dll' for writing -- 'The process cannot access the file 'C:\\a\\w\\1\\s\\src\\Project\\obj\\Debug\\netstandard1.4\\Project.dll' because it is being used by another process.'`\r\n\r\nSometimes there are warnings:\r\n\r\n`warning MSB3026: Could not copy \"obj\\Debug\\netstandard1.4\\Project.dll\" to \"bin\\Debug\\netstandard1.4\\Project.dll\". Beginning retry 1 in 1000ms. The process cannot access the file 'C:\\a\\w\\1\\s\\src\\Project\\bin\\Debug\\netstandard1.4\\Project.dll' because it is being used by another process. [C:\\a\\w\\1\\s\\src\\Project\\Project.csproj]`\r\n\r\nErrors and warnings can occur for different projects.\r\n\r\nSwitching from `dotnet build` to `msbuild /maxcpucount:1` avoids the problems.\r\n\r\nThe errors occur more frequently on build servers (Azure VMs, Standard F2S) than on laptop (i7-5600U, 16GB, SSD).\r\n\r\nOur build script replaces version numbers in AssemblyInfo.cs files, so many projects are rebuilt on every build.\r\n\r\nExecuting `dotnet build --no-incremental` also seems to increase failure rate locally (where otherwise repeated builds may not build all projects).\r\n\r\n## Environment data\r\n`dotnet --info` output:\r\n\r\n    .NET Command Line Tools (1.0.0-preview3-004056)\r\n\r\n    Product Information:\r\n     Version:            1.0.0-preview3-004056\r\n     Commit SHA-1 hash:  ccc4968bc3\r\n\r\n    Runtime Environment:\r\n     OS Name:     Windows\r\n     OS Version:  10.0.14393\r\n     OS Platform: Windows\r\n     RID:         win10-x64\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/dotnet/cli/issues/comments/261745984","html_url":"https://github.com/dotnet/cli/issues/4786#issuecomment-261745984","issue_url":"https://api.github.com/repos/dotnet/cli/issues/4786","id":261745984,"user":{"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},"created_at":"2016-11-19T23:08:59Z","updated_at":"2016-11-19T23:08:59Z","body":"Are there any custom build scripts involved? Particularly direct MSbuild invocations?  Is this a sln build or multiple parallel project builds?\r\n\r\n@nguerrera @dsplaisted "}}
{"actor":{"display_login":"piotrpMSFT"}}