"Cannot import this web part"

Mar 14, 2008 at 9:15 PM
I simply compiled the default project created from the template, and installed it successfully. However, when I try to add the web part I get "Unable to add selected web part(s). WebPart1: Cannot import this web part". Is something missing in the project that prevents a very simple "Hello World" style web part from working?
Mar 14, 2008 at 10:43 PM
you should edit the web.config for that site collection, turning off custom errors, and enabling trace output & stack output, so that you can see more detail on the error. Go to the web parts gallery and preview the web part by clicking it's name.


<SafeMode MaxControls="200" CallStack="true" DirectFileDependencies="10" TotalFileDependencies="50" AllowPageLevelTrace="true">
...
<customErrors mode="Off" />


and if that doesn't help you, check the ULS logs (look for category "WebParts")
\program files\common files\microsoft shared\web server extenstions\12\logs\


ericmlegault wrote:
I simply compiled the default project created from the template, and installed it successfully. However, when I try to add the web part I get "Unable to add selected web part(s). WebPart1: Cannot import this web part". Is something missing in the project that prevents a very simple "Hello World" style web part from working?

Mar 17, 2008 at 5:29 AM
I'm not sure what I did wrong, but I started another project and everything works fine now. One thing I did notice is that by default the output goes to the bin\release folder when you first compile - and the wsp builder will complain about a missing file because it is looking in bin\debug.

Eric


FeL0niOuSmOnK wrote:
you should edit the web.config for that site collection, turning off custom errors, and enabling trace output & stack output, so that you can see more detail on the error. Go to the web parts gallery and preview the web part by clicking it's name.


<SafeMode MaxControls="200" CallStack="true" DirectFileDependencies="10" TotalFileDependencies="50" AllowPageLevelTrace="true">
...
<customErrors mode="Off" />


and if that doesn't help you, check the ULS logs (look for category "WebParts")
\program files\common files\microsoft shared\web server extenstions\12\logs\


ericmlegault wrote:
I simply compiled the default project created from the template, and installed it successfully. However, when I try to add the web part I get "Unable to add selected web part(s). WebPart1: Cannot import this web part". Is something missing in the project that prevents a very simple "Hello World" style web part from working?


Mar 18, 2008 at 2:11 PM
ah yes, that might happen.

i avoid this i always set the output path to simply \bin\ :)