{"action":"created","issue":{"url":"https://api.github.com/repos/OData/WebApi/issues/1082","repository_url":"https://api.github.com/repos/OData/WebApi","labels_url":"https://api.github.com/repos/OData/WebApi/issues/1082/labels{/name}","comments_url":"https://api.github.com/repos/OData/WebApi/issues/1082/comments","events_url":"https://api.github.com/repos/OData/WebApi/issues/1082/events","html_url":"https://github.com/OData/WebApi/pull/1082","id":259154048,"number":1082,"title":"Call BuildServiceProvider using reflection to make it compatible with both MS.Extensions.DependencyInjection 1 & 2","user":{"login":"ysmoradi","id":5352980,"avatar_url":"https://avatars2.githubusercontent.com/u/5352980?v=4","gravatar_id":"","url":"https://api.github.com/users/ysmoradi","html_url":"https://github.com/ysmoradi","followers_url":"https://api.github.com/users/ysmoradi/followers","following_url":"https://api.github.com/users/ysmoradi/following{/other_user}","gists_url":"https://api.github.com/users/ysmoradi/gists{/gist_id}","starred_url":"https://api.github.com/users/ysmoradi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ysmoradi/subscriptions","organizations_url":"https://api.github.com/users/ysmoradi/orgs","repos_url":"https://api.github.com/users/ysmoradi/repos","events_url":"https://api.github.com/users/ysmoradi/events{/privacy}","received_events_url":"https://api.github.com/users/ysmoradi/received_events","type":"User","site_admin":false},"labels":[{"id":197989415,"url":"https://api.github.com/repos/OData/WebApi/labels/cla-already-signed","name":"cla-already-signed","color":"009800","default":false}],"state":"open","locked":false,"assignee":{"login":"AlanWong-MS","id":22382722,"avatar_url":"https://avatars1.githubusercontent.com/u/22382722?v=4","gravatar_id":"","url":"https://api.github.com/users/AlanWong-MS","html_url":"https://github.com/AlanWong-MS","followers_url":"https://api.github.com/users/AlanWong-MS/followers","following_url":"https://api.github.com/users/AlanWong-MS/following{/other_user}","gists_url":"https://api.github.com/users/AlanWong-MS/gists{/gist_id}","starred_url":"https://api.github.com/users/AlanWong-MS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlanWong-MS/subscriptions","organizations_url":"https://api.github.com/users/AlanWong-MS/orgs","repos_url":"https://api.github.com/users/AlanWong-MS/repos","events_url":"https://api.github.com/users/AlanWong-MS/events{/privacy}","received_events_url":"https://api.github.com/users/AlanWong-MS/received_events","type":"User","site_admin":false},"assignees":[{"login":"AlanWong-MS","id":22382722,"avatar_url":"https://avatars1.githubusercontent.com/u/22382722?v=4","gravatar_id":"","url":"https://api.github.com/users/AlanWong-MS","html_url":"https://github.com/AlanWong-MS","followers_url":"https://api.github.com/users/AlanWong-MS/followers","following_url":"https://api.github.com/users/AlanWong-MS/following{/other_user}","gists_url":"https://api.github.com/users/AlanWong-MS/gists{/gist_id}","starred_url":"https://api.github.com/users/AlanWong-MS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlanWong-MS/subscriptions","organizations_url":"https://api.github.com/users/AlanWong-MS/orgs","repos_url":"https://api.github.com/users/AlanWong-MS/repos","events_url":"https://api.github.com/users/AlanWong-MS/events{/privacy}","received_events_url":"https://api.github.com/users/AlanWong-MS/received_events","type":"User","site_admin":false}],"milestone":null,"comments":8,"created_at":"2017-09-20T13:00:12Z","updated_at":"2017-09-25T19:41:12Z","closed_at":null,"author_association":"NONE","pull_request":{"url":"https://api.github.com/repos/OData/WebApi/pulls/1082","html_url":"https://github.com/OData/WebApi/pull/1082","diff_url":"https://github.com/OData/WebApi/pull/1082.diff","patch_url":"https://github.com/OData/WebApi/pull/1082.patch"},"body":"### Issues\r\n\r\nShort version of story:\r\n\r\nMicrosoft.Extensions.DependencyInjection has a class called **ServiceCollectionContainerBuilderExtensions** which has a method named **BuildServiceProvider**. In MS.Extensions.DependencyInjection 1.0, it was returning **IServiceCollection** and in version 2.0 it returns **ServiceCollection**\r\n\r\n[This is a breaking change](https://github.com/aspnet/DependencyInjection/issues/550) and you've to either recompile your code or use dynamic method call using reflection. I'm not a fan of recompile against MS.Extensions.DependencyInjection 2.0, because it forces all developers who are using Microsoft.AspNet.OData 6.0+ to use .NET standard 2.0 based tools such as VS 2017.3 and the project itself should be updated from .NET 4.5 to .NET 4.6.1\r\n\r\nUsing dynamic method call, MS.AspNet.OData 6.0+ becomes compatible with both MS.Extensions.DependencyInjection 1 & 2.  **I've tested that code a lot and it works like a charm** and it makes **no breaking change** to this fantastic library at all.\r\n\r\nThis allows us to use libraries such as EntityFramework Core 2.0 and lots of other libraries on nuget.org which are dependent on MS.Extensions.DependencyInjection 2.0.\r\n\r\nThanks in advance\r\n\r\nIssue link >> https://github.com/OData/WebApi/pull/1058#issuecomment-326710746\r\n\r\n### Checklist (Uncheck if it is not completed)\r\n\r\n- [ x ] Build and test with one-click build and test script passed\r\n\r\n### Additional work necessary\r\n\r\n**Change nuspec** dependencies from:\r\n\r\n```\r\nMicrosoft.Extensions.DependencyInjection (>= 1.0.0 && < 2.0.0) \r\nMicrosoft.Extensions.DependencyInjection.Abstractions (>= 1.0.0 && < 2.0.0) \r\n```\r\n\r\nto\r\n\r\n```\r\nMicrosoft.Extensions.DependencyInjection (>= 1.0.0) \r\nMicrosoft.Extensions.DependencyInjection.Abstractions (>= 1.0.0) \r\n```"},"comment":{"url":"https://api.github.com/repos/OData/WebApi/issues/comments/331989992","html_url":"https://github.com/OData/WebApi/pull/1082#issuecomment-331989992","issue_url":"https://api.github.com/repos/OData/WebApi/issues/1082","id":331989992,"user":{"login":"AlanWong-MS","id":22382722,"avatar_url":"https://avatars1.githubusercontent.com/u/22382722?v=4","gravatar_id":"","url":"https://api.github.com/users/AlanWong-MS","html_url":"https://github.com/AlanWong-MS","followers_url":"https://api.github.com/users/AlanWong-MS/followers","following_url":"https://api.github.com/users/AlanWong-MS/following{/other_user}","gists_url":"https://api.github.com/users/AlanWong-MS/gists{/gist_id}","starred_url":"https://api.github.com/users/AlanWong-MS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlanWong-MS/subscriptions","organizations_url":"https://api.github.com/users/AlanWong-MS/orgs","repos_url":"https://api.github.com/users/AlanWong-MS/repos","events_url":"https://api.github.com/users/AlanWong-MS/events{/privacy}","received_events_url":"https://api.github.com/users/AlanWong-MS/received_events","type":"User","site_admin":false},"created_at":"2017-09-25T19:41:12Z","updated_at":"2017-09-25T19:41:12Z","author_association":"CONTRIBUTOR","body":"No worries. Please let us know if the build didn't tell you about the style issue when you built locally. We aim to let developers know about these checks as soon as possible to reduce time back-and-forth."}}
{"actor":{"display_login":"AlanWong-MS"}}