Unity compile error fills console on project startup

Running 18.1.5f1 personal on a Windows 10 PC.

I installed CineMachine via Package Manager, then began to see these messages. I closed my project and created a new project.

Immediately on opening the new project, these messages began and fill the console (999+). I created another empty project and deleted CineMachine but the messages continued in this third project.

NullReferenceException: Object reference not set to an instance of an object
UnityEditor.Scripting.Compilers.ScriptCompilerBase.CompilationHadFailure () (at C:/buildslave/unity/build/Editor/Mono/Scripting/Compilers/ScriptCompilerBase.cs:342)
UnityEditor.Scripting.Compilers.ScriptCompilerBase.DumpStreamOutputToLog () (at C:/buildslave/unity/build/Editor/Mono/Scripting/Compilers/ScriptCompilerBase.cs:356)
UnityEditor.Scripting.Compilers.ScriptCompilerBase.GetCompilerMessages () (at C:/buildslave/unity/build/Editor/Mono/Scripting/Compilers/ScriptCompilerBase.cs:335)
UnityEditor.Scripting.ScriptCompilation.CompilationTask.Poll () (at C:/buildslave/unity/build/Editor/Mono/Scripting/ScriptCompilation/CompilationTask.cs:105)
UnityEditor.Scripting.ScriptCompilation.EditorCompilation.PollCompilation () (at C:/buildslave/unity/build/Editor/Mono/Scripting/ScriptCompilation/EditorCompilation.cs:1031)
UnityEditor.Scripting.ScriptCompilation.EditorCompilation.TickCompilationPipeline (EditorScriptCompilationOptions options, BuildTargetGroup platformGroup, BuildTarget platform) (at C:/buildslave/unity/build/Editor/Mono/Scripting/ScriptCompilation/EditorCompilation.cs:1024)
UnityEditor.Scripting.ScriptCompilation.EditorCompilationInterface+c__AnonStorey4.<>m__0 () (at C:/buildslave/unity/build/Editor/Mono/Scripting/ScriptCompilation/EditorCompilationInterface.cs:266)
UnityEditor.Scripting.ScriptCompilation.EditorCompilationInterface.EmitExceptionAsError[CompileStatus] (System.Func`1 func, CompileStatus returnValue) (at C:/buildslave/unity/build/Editor/Mono/Scripting/ScriptCompilation/EditorCompilationInterface.cs:85)
UnityEditor.Scripting.ScriptCompilation.EditorCompilationInterface:TickCompilationPipeline(EditorScriptCompilationOptions, BuildTargetGroup, BuildTarget)

Figuring that these errors were the result of ‘project spaghetti’, I decided to delete Unity 18.1.5f1 and load a fresh copy of the latest.

This morning I installed Unity 18.1.6f1 and opened an empty project. The error messages did not recur so, apparently, all is well.

These NullReferenceException error messages are a result of the project referencing an older version of .NET Framework.

The Fix:

  1. Select “Project Setting > Player” from the “Edit” menu bar item
  2. Select the “Other Settings” group tab under the [Down-arrow]
  3. Change the “Scripting Runtime Version” to say “.NET 4.x Equivalent”
  4. Select “Save Project” from the “File” menu bar item
  5. Restart Unity

You should no longer see any the errors in the Console view.