Object reference not set to an instance of an object

我用開嘅 Visual Studio 2015 無端端出現哩個 error:

Object reference not set to an instance of an object

之前曾經出現過一啲無厘頭嘅 errors,不過自從用咗 Run as administrator 就好似冇哂,所以就一直冇理佢係咩原因會咁,寫下 program 啫,唔使下下都要做柯南㗎!係咪?😎

今次想喺 VS 2015 create 一個新 project 就出咗事,冇哂符:

  • 關哂啲 Visual Studio opened projects
  • 重新用 Run as administrator 開
  • reboot 部機

都係唔得嘅,😂

Google 一下,原來好多網友都遇見過,最早期出現嘅係 2009 年!無人講過係咩原因,衹知有好多不同方法,有啲解決倒,有啲用同一個方法就解決唔倒,亦冇官方說明。哎,Microsoft!

有一說法教你打開 Visual Studio Command Prompt,用:

devenv /ResetSettings
devenv /ResetSkipPKGS

將 recent 嘅 Visual Studio 設定剎哂,自殘!都…係…唔…得!

剎得性起,再嚟,去 DOS Prompt 將哩兩個 folders 刪掉(我冇咁極端,我 rename 啫):


C:\Users\{user}\AppData\Local\Microsoft\VisualStudio

C:\Users\{user}\AppData\Local\Microsoft\VSCommon

呵呵呵,掂番,個 error 消失咗!

係咩原因?唔知,我歸納為「微軟效應」。 😜