Why am I getting, “Object reference not set to an instance of an object.” but no line of code is implicated?

会有一股神秘感。 提交于 2019-11-27 09:47:00

This was an incredibly strange issue, but since there it has been solved, it might as well get an answer.

I think it's a bug in the .suo files, as my VS was behaving oddly lately, my programs suddenly started crashing, not building and saying the Office references were not valid.

One fix I tried was cleaning and re-building the solution, which worked about 1/4 in times, the other times I had to physically remove and add the references again, and then rebuild the whole solution.

After getting fed up of doing that for a week or so, I just created a backup elsewhere on our work server, deleting the .suo files in the new folder, then opening and building the whole solution.

It fixed it. Not sure why, or what went wrong, but now and then strange things happen in the .suo files and references.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!