Ever since I upgraded from VS2010 to VS2012 I am experiencing a strange compilation issue. I have searched the web quite a bit and haven't found a bug report, so I'm wondering if anybody here has run into a similar issue. Can it be fixed?
EDIT: I am running VS2012 Update 2 on Windows 7 x64 with all patches applied.
Sometimes, especially when compiling the entire solution just after checking-out from SVN, one of the projects fails to build with an exception Object reference not set to an instance of an object
. After this, if I hit build/rebuild again, it works! It doesn't happen all the time, so I have no idea why. I have checked the solution, the project and its references and there doesn't seem to be anything odd with it.
The build window shows something like:
... blah blah, everything fine ...
114>------ Build started: Project: C:\...\mymainwebproject\, Configuration: Debug Any CPU ------
114>Validating Web Site
114>: Build (web): Object reference not set to an instance of an object.
114>
114>Validation Complete
... blah blah, everything fine ...
========== Build: 118 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
And the error window looks like (my reputation is too low to post images yet here's the link):
http://i.imgur.com/piSfLR8.png
Any feedback is welcome. Thanks.