Visual Studio 2010 reports hard-to-debug errors during deployment some times. A quick and easy way to do some very rough debugging is to throw your own named exceptions. Visual Studio will show them in the output console.
Consider this bit of code:
If this feature is scoped to a web application, site will be null. If you try and reference a property of site, you’ll get the ambiguous error:
Error occurred in deployment step ‘Add Solution’: Object reference not set to an instance of an object.
However, if throw a new Exception and pass a string to the constructor, you get a slightly more useful message:
It’s a crude technique, but pretty fast and easy.
</end>
Follow me on Twitter at http://www.twitter.com/pagalvin
nice and helpful, thanks