Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save humbertodias/365bd3212894431972058e349d7e06ec to your computer and use it in GitHub Desktop.
Save humbertodias/365bd3212894431972058e349d7e06ec to your computer and use it in GitHub Desktop.
Setup C# 7.x compilation in Unity 2018.2 and Visual Studio 2017

Set the unity scripting runtime to ".NET 4.x Equivalent"

In Unity goto "Edit->Preferences->Player" then find and set "Scripting Runtime Version*" to ".NET 4.x Equivalent"

Install Unity's IncrementalCompiler

Add dependency

"com.unity.incrementalcompiler": "0.0.42-preview.31"

in manifest.json

https://docs.unity3d.com/Packages/com.unity.incrementalcompiler@0.0/manual/index.html

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

Setup C# 7.x compilation with Visual Studio 2017 tools

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment