Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

In my local machine i deployed my web part and also i can use it but when i want to use this web part another sharepoint site importing web part shows this error:

$Resources:core,ImportErrorMessage;

Does anybody have any suggestions?

share|improve this question

1 Answer 1

Not much info to go buy, but if you imported a custom web part to another SharePoint site, it will not work!

The reason is that the assembly behind the web part is not allowed to run on that site by the safe mode parser (SafeControls in web.config).

Try and install the web part solution in the new SharePoint solution and see if this solves the problem!

share|improve this answer
    
I wonder why Import/export webpart option is there if you cant import it :S –  Muhammad Raja Jul 27 '12 at 12:44
    
you can actually import/export the webpart properties. But if the webpart is custom and have code, the target farm must know the webpart, and its code. –  Steve B Jul 27 '12 at 13:08
    
you only export the webpart manifest xml, not the actual source code that it refers. If running on the same machine, and you deploy to the GAC, the code will be there, but it is not allowed to run for the safe mode parser since the IIS web.config does not contain SafeControl entries. This is a security measure to disallow "normal" users (in this case any user with Designer permissions) to upload malicious code to a site. As @SteveB mentions, if the webpart is already installed (and hence registered as safe) you can export the webpart XML, edit it & upload it either to wp gallery or to site. –  Anders Rask Jul 27 '12 at 14:49

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.