SharePoint error: “Cannot import Web Part”

前端 未结 11 1592
青春惊慌失措
青春惊慌失措 2021-02-08 02:33

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

11条回答
  •  自闭症患者
    2021-02-08 03:13

    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.

提交回复
热议问题