How can I debug "Object reference not set to an instance of an object" in VS2013?

Unfortunately, I never did discover a way to debug issues of this sort in a more general way. I eventually worked around the problem, and then saw it pop up again; following advice someone else tried on another forum, I deleted my packages folder, and had NuGet recreate it, which for whatever reason corrected the issue.

Another time, a solution from this question worked (remove and re-add all roles); sometimes this seemed to require an Azure SDK reinstall and computer restart as well.

EDIT

Finally, the best solution I could find was here: delete SUO files and restart VS.

Hopefully this solution will help someone with a similar problem in the future!


tick Debug > Exceptions > Common Language Runtime Exceptions > System > NullReferenceException and run your app


You can enable Intellitrace and remote debug your azure services:

http://blogs.msdn.com/b/webdev/archive/2013/11/05/remote-debugging-a-window-azure-web-site-with-visual-studio-2013.aspx