With all of the excitement with Sitecore 9.X, sometimes it is very tempting to fire up a new project, get the latest NuGet packages and off you go, but there are a few subtle things to remember that Sitecore is embracing rather more niche dependencies and having embracing Microsoft.Extensions.DependencyInjection library from Microsoft is also one of them.
With Sitecore 9.0.X (pre 9.1), Sitecore Dependency Injection mechanism is dependent on on Microsoft.Extensions.DependencyInjection version 1.X. If you are happen to add NuGet Package with version >2.X then you will get the following awesome message when deploying to the instance:
Method not found: ‘System.IServiceProvider Microsoft.Extensions.DependencyInjection.ServiceCollectionContainerBuilderExtensions.BuildServiceProvider(Microsoft.Extensions.DependencyInjection.IServiceCollection)’…
Please beware, to keep the version of dependencies strictly to what is provided by the version of the platform. Review carefully.