{"action":"closed","issue":{"url":"https://api.github.com/repos/Microsoft/msbuild/issues/3036","repository_url":"https://api.github.com/repos/Microsoft/msbuild","labels_url":"https://api.github.com/repos/Microsoft/msbuild/issues/3036/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/msbuild/issues/3036/comments","events_url":"https://api.github.com/repos/Microsoft/msbuild/issues/3036/events","html_url":"https://github.com/Microsoft/msbuild/issues/3036","id":300591981,"node_id":"MDU6SXNzdWUzMDA1OTE5ODE=","number":3036,"title":"ToolLocationHelper.GetPathToReferenceAssemblies not thread safe","user":{"login":"jairbubbles","id":15875066,"node_id":"MDQ6VXNlcjE1ODc1MDY2","avatar_url":"https://avatars1.githubusercontent.com/u/15875066?v=4","gravatar_id":"","url":"https://api.github.com/users/jairbubbles","html_url":"https://github.com/jairbubbles","followers_url":"https://api.github.com/users/jairbubbles/followers","following_url":"https://api.github.com/users/jairbubbles/following{/other_user}","gists_url":"https://api.github.com/users/jairbubbles/gists{/gist_id}","starred_url":"https://api.github.com/users/jairbubbles/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jairbubbles/subscriptions","organizations_url":"https://api.github.com/users/jairbubbles/orgs","repos_url":"https://api.github.com/users/jairbubbles/repos","events_url":"https://api.github.com/users/jairbubbles/events{/privacy}","received_events_url":"https://api.github.com/users/jairbubbles/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-02-27T11:22:46Z","updated_at":"2018-07-25T22:05:39Z","closed_at":"2018-07-25T22:05:39Z","author_association":"NONE","body":"*Sadly no clear repro on this one but I think a fix can be found by just looking at the code (which I did briefly).*\r\n\r\nI'm evaluating in // many .csproj from a huge solution (hundreds of projects) to get their output path. Sometimes on some build machines I get:\r\n```\r\nThe expression \"[Microsoft.Build.Utilities.ToolLocationHelper]::GetPathToStandardLibraries(.NETFramework, v4.6.1, '', AnyCPU)\" cannot be evaluated. \r\nCollection was modified; enumeration operation may not execute. \r\nC:\\Program Files (x86)\\MSBuild\\14.0\\bin\\amd64\\Microsoft.Common.CurrentVersion.targets\r\n```\r\n\r\nI'm using Microsoft.Build@15.5.180 and my .sln is a VS2015 one.\r\n\r\nWhen looking at the code:\r\nhttps://github.com/Microsoft/msbuild/blob/75e5117ab8be40faad4601904600aceae6bf9ee1/src/Utilities/ToolLocationHelper.cs#L1779\r\nThere is some lock around some static variables but I guess some might be missing when iterating on the returned list. Maybe use ConcurrentDictionnary ?\r\n"}}
{"actor":{"display_login":"cdmihai"}}