5

After diligently working hard on code today I noticed something strange: after ending my debugging session and coming back to my MVC controller I get an actual pop up alert indicating "Object reference not set to an instance of an object". I don't get one, I get a whole cascade of them and VS basically locks up the point of needing a reboot. This seem unusual since I'm not debugging anything and this error is coming up in Visual Studio 2013 itself, not in any code errors or error panels.

What I've done to try to fix this:

  • Refreshed my database on localhost. This did not fix it.
  • Rapidly hit the keyboard shortcut to rebuild the project. This works about 75% of the time.
  • Try to clean the project before the alert cascade show happens. This always fixed it when coupled with a VS restart. If I run the debugger to test my web application it comes back.
  • This does not come back with other projects.

The code function I'm dealing with is related to quizzes - I've created tested the initial quiz taking function as of a week ago, but now I'm working on a "resume quiz" function. So very similar and some shared methods in the controller.

This is pretty much a hard stop for me since my entire IDE is useless for this part of code. Has anyone run into VS itself saying "object reference not set to an instance of an object"?

John Saunders
  • 160,644
  • 26
  • 247
  • 397
Dreamcasting
  • 454
  • 2
  • 5
  • 21
  • 1
    Any change you are using some extensions or productivity tools? There is a tone of bugs in those alone. – FailedDev May 12 '15 at 16:51
  • You could attempt to get more information from VS by enabling the log. https://msdn.microsoft.com/en-us/library/ms241272.aspx – Brian from state farm May 12 '15 at 16:51
  • @FailedDev Nothing beyond the basic MVC5 template w/bootstrap and jQuery and Entity. I also didn't change any of these or update in the last several weeks. – Dreamcasting May 12 '15 at 16:53
  • I would do a "repair" install of Visual Studio before proceeding further - just to baseline things. – John Saunders May 12 '15 at 16:56
  • There is a good chance that exception is valid (assuming it is regular exception dialog during debugging) - have you looked at callstack? Also consider posting sample of your code (preferably with non-awited async operations that blow up after request is finished) – Alexei Levenkov May 12 '15 at 17:29
  • @AlexeiLevenkov There isn't a stack to be had since this error is being broadcast by VS, not the debugger. – Dreamcasting May 12 '15 at 17:46
  • Update: I've repaired VS as @JohnSaunders suggested, but this didn't fix it. I did clean the solution and update all the frameworks, then uninstalled the testing solutions used by our shop. I had to fiddle with the web.config references to OWIN (had a wrong version number), but so far it seems to be working. I'm not going to mark this as answered so I can test a little more first, and make sure it's quashed. – Dreamcasting May 12 '15 at 18:06
  • 1
    "update all the frameworks ... testing solutions" - could you please tell us what those are? In your question? – John Saunders May 12 '15 at 18:30

2 Answers2

2

Updating for those who come to see this later:

  • I don't know exactly what was broken, the devenv log didn't show it.
  • I uninstalled all my extensions and add-ons (just VS Web Essentials, Telerik Testing Studio and Ranorex Test Automation) and then repaired my VS install.
  • Lastly, I updated all frameworks in the project via the "Extensions and Updates" option under Tools in the VS Menu and my problem went away.
Dreamcasting
  • 454
  • 2
  • 5
  • 21
0

Had the same issue with VS2017 and fixed it with

https://stackoverflow.com/a/36056076/3772108

Then I changed the target browser from Chrome to IE. Then F5, wait, stop the whole thing and changed it back to the chrome. Maybe this helps someone too.

user3772108
  • 854
  • 2
  • 14
  • 32