'IServiceCollection' does not contain a definition for 'AddSession'
I know this is a bit late, but did you try to install the Microsoft.AspNetCore.Session package from nuget?
https://www.nuget.org/packages/Microsoft.AspNetCore.Session/
In Visual Studio: Install-Package Microsoft.AspNetCore.Session -Version 1.1.2(in my case)
It worked for me!
The following way I fixed the Issue.
- Clean and Rebuild the solution.
- Restart Visual Studio 2017.
Thanks @HenkMollema