SharePoint error: “Cannot import Web Part”

前端 未结 11 1420
青春惊慌失措
青春惊慌失措 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条回答
  •  闹比i
    闹比i (楼主)
    2021-02-08 02:49

    I got this error when I created a base class web part and then inherited a derived class from it. The base class was fine but the derived class failed when I tried to add it to a web page with the same error as the original post. In my case I had to add a public modifier to the class:

    public class DerivedWebPart : BaseWebPart
    

    Also I added a constructor in the derived class to call the base class one - although I think you shouldn't need this really:

        public DerivedWebPart() : base()
        {
        }
    

提交回复
热议问题