The dependency versions do not seem to be synchronized. Use Nuget to upgrade all your packages to the same version, and this should fix the problem. This applies to most, if not all Microsoft packages. *.
You also need the following operators:
using Microsoft.AspNetCore.Builder; using Microsoft.Extensions.DependencyInjection; using System;
source share