{"action":"created","issue":{"url":"https://api.github.com/repos/autofac/Autofac/issues/666","labels_url":"https://api.github.com/repos/autofac/Autofac/issues/666/labels{/name}","comments_url":"https://api.github.com/repos/autofac/Autofac/issues/666/comments","events_url":"https://api.github.com/repos/autofac/Autofac/issues/666/events","html_url":"https://github.com/autofac/Autofac/issues/666","id":97152952,"number":666,"title":"Issue with LifeTimeScope.GetOrCreateAndShare","user":{"login":"hackfaq","id":2344814,"avatar_url":"https://avatars.githubusercontent.com/u/2344814?v=3","gravatar_id":"","url":"https://api.github.com/users/hackfaq","html_url":"https://github.com/hackfaq","followers_url":"https://api.github.com/users/hackfaq/followers","following_url":"https://api.github.com/users/hackfaq/following{/other_user}","gists_url":"https://api.github.com/users/hackfaq/gists{/gist_id}","starred_url":"https://api.github.com/users/hackfaq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hackfaq/subscriptions","organizations_url":"https://api.github.com/users/hackfaq/orgs","repos_url":"https://api.github.com/users/hackfaq/repos","events_url":"https://api.github.com/users/hackfaq/events{/privacy}","received_events_url":"https://api.github.com/users/hackfaq/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-07-24T21:41:25Z","updated_at":"2015-07-25T14:09:39Z","closed_at":null,"body":"I have WCF service, and on method calls I get exception:\r\n\r\n```\r\nAn item with the same key has already been added.\r\n\r\nSystem.ThrowHelper.ThrowArgumentException(ExceptionResource resource)\r\n   в System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)\r\n   в System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value)\r\n   в Autofac.Core.Lifetime.LifetimeScope.GetOrCreateAndShare(Guid id, Func`1 creator)\r\n```\r\n\r\nas I investigated sources such error can't happen, because it checks before add."},"comment":{"url":"https://api.github.com/repos/autofac/Autofac/issues/comments/124849381","html_url":"https://github.com/autofac/Autofac/issues/666#issuecomment-124849381","issue_url":"https://api.github.com/repos/autofac/Autofac/issues/666","id":124849381,"user":{"login":"alexmg","id":131293,"avatar_url":"https://avatars.githubusercontent.com/u/131293?v=3","gravatar_id":"","url":"https://api.github.com/users/alexmg","html_url":"https://github.com/alexmg","followers_url":"https://api.github.com/users/alexmg/followers","following_url":"https://api.github.com/users/alexmg/following{/other_user}","gists_url":"https://api.github.com/users/alexmg/gists{/gist_id}","starred_url":"https://api.github.com/users/alexmg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexmg/subscriptions","organizations_url":"https://api.github.com/users/alexmg/orgs","repos_url":"https://api.github.com/users/alexmg/repos","events_url":"https://api.github.com/users/alexmg/events{/privacy}","received_events_url":"https://api.github.com/users/alexmg/received_events","type":"User","site_admin":false},"created_at":"2015-07-25T14:09:39Z","updated_at":"2015-07-25T14:09:39Z","body":"I think I see the problem. I'll take a look. I suspect we should also prevent the creator function from being invoked a second time too, even if the second lock prevents the instance from being added to the dictionary."}}