When creating a web in Visual Studio it generates a web part where the namespace and the class name is the same. I'm thinking that this is giving me a problem with the limitedWebManager.ImportWebPart call. I'm fetching the .webpage file from the web part library and then adding it using ImportWebPart. I get the "not registerd as save" error (they work when I add them to the page manually, and it is in the web.config file). It works fine with "out of the box" webparts. But not with custome webpart.
I'm though maybe it has something to do with the class name and the namespace are the same. I tried to make test web part, and it did not work first (same error), but then I renamed it to not have the same name as the namespace and it worked. But I'm still unsure if that is the problem or not. So if someone have the same experience and can confirm my theory or not?