I have a web part that I\'ve developed, and if I manually install the web part it is fine.
However when I have packaged the web part following the instructions on this w
We had this same problem and found that the constructor of our web part was being called by the WebPartImporter and within the constructor we were doing SPSecurity.RunWithElevatedPrivileges.
For some reason the WebPartImporter cannot handle this. So, we simply moved our code out of the constructor to OnInit (where it really belonged) and all is well.