When I compile .NET solution, which is an ASP.NET 3.5 website project and a few class libraries, sometimes we get COMPILE error "Object reference not set to an instance of an object". Doesn't give you any additional information, like it usually does - which project, file, line of code or anything like that. Usually if you stop and re-compile it disappears but re-appears once in a while. Some developers think it comes from report control that we use to view SSRS reports but no one is certain. Same happens with everyone on a project. How would you investigate this kind of problem, what would you look at first, and what kinds of tools would you use.
A:
It could be that your designer files are out of sync with the aspx. There maybe references to controls that no longer exist in the web form.
I'd also suggest taking a look at the Output window (View > Output). That might give you more clues as to where the error is happening.
Naeem Sarfraz
2010-02-03 17:39:02
Thanks for reply. Ok, I will take a look at Output window. Problem is I cannot reproduce it on demand, so it will take some patience:-) If it was a reference to a missing control, wouldn't it appear every time I compile?
Victor
2010-02-03 17:45:51