The other day I had a very strange Visual Studio 2005 experience. I was testing the new design time capabilities of r.a.d.tabstrip
and something went extremely wrong. My test environment consists of a WebControlLibrary project (the control itself) and a WebSite with a single aspx page containing nothing but a humble r.a.d.tabstrip
. The site has a project reference to the web control library so it gets rebuilt whenever I build the site. So far so good.
Here is the fun part - whenever I rebuilt the site and refreshed the page I received the following error:
Ok, i said to myself, it's debugging time. I attached a second Visual Studio 2005 and waited to catch the exception and see what's going on. Unlucky! r.a.d.tabstrip
was doing fine in the second Visual Studio - no errors whatsoever. I thought it was my bad luck and continued with my work - closed the first "baaad" studio and continued with the second. The new feature was actually working and I, pleased with my success and superior programming skills, decided to implement another one. Tough luck - same error again after rebuild. I closed Visual Studio and opened it again - everything was fine! Rebuild - error. After a few more tries I got the pattern - rebuilding r.a.d.tabstrip
makes Visual Studio show errors!
Here in telerik we have the practice when researching various capabilities (such as Visual Studio 2005 design time enhancements) to implement them in a so called "spike
" project - then we know if it actually works and spread the goods among the products.
After several hours spent in mad debugging I decided to try that spike and see if it breaks Visual Studio in the same way. No! It worked just fine. A quick WinMerge
showed that I was missing one important bit - AssemblyInfo.cs. I plugged a brand new AssemblyInfo.cs with all the required stuff and ... it just worked! Without that file my assembly was being built with version "0.0.0.0" which by some reason prevented Visual Studio from working correctly.
Was that a stupid mistake? Yes - every .net project should have an AssemblyInfo.cs!
Was the error message helpful? By no means!!! It made me debug all day long without a clue what is actually going on.
The moral of this blog post would be "Never show meaningless error messages to your users. If you have no idea what's gone wrong just admit it."