You know this error?
You just developed a new web part, all excited and ready to test it and wham!
Unable to add selected web part(s).
[Web Part Title]: One of the properties of the Web Part has an incorrect format. Windows SharePoint Services cannot deserialize the Web Part. Check the format of the properties and try again.
Well, this keeps happening to me (not the first time, and definitly not the last) so I thought I'd share one of the reasons for this message to appear.
This meesage can apear in various situations - so feel free to comment with your own "check list" for this error.
Check your class definitions. In most cases - if you forget to mark it as "public class" you will get this error.
Check your properties definitions. Could it be that custom logic in get/set throws and exception?
Check your DWP/Webpart file. It may point to a property that does not exist (removed / spelling mistake), or the assembly is not registered correctly. Best way to troubleshoot this is: Go to your site collection settings, to web parts gallery, click "new" and add your web part to the gallery. Try the new DWP/Webpart file created - does it work?
For Bin installations - make sure your DLL is in the bin folder of the current web application. Make sure it is registered as safe control in the web.config with no spelling mistakes.
For GAC installations - make sure your DLL is in the GAC, if you changed it recently try an IISRESET. Also - Make sure it is registered as safe control in the web.config for each web application with no spelling mistaked.
Ok, this is what I can come up with now... Share your experience, this error can get pretty annoying!
Hope I helped save lifes on this (or at least, made the world a better place with less developers screaming in the middle of the night).
Brought to you as a public service by Shai, KWizCom :)