In Unity goto "Edit->Preferences->Player" then find and set "Scripting Runtime Version*" to ".NET 4.x Equivalent"
In Unity:
- Goto "Window->Package manager->All" then find and install the IncrementalCompiler
- Goto "Unity Preferences->Compiler" and set "Enable building from IDE" to True
In Visual Studio 2017:
- Goto "Tools->Options->Tools for Unity" and set "Access to project properties" to True
- Then from the solution explorer right click the project and goto "Properties->Build->Advanced" and set language version C# 7.x