keyongtech


  keyongtech > sharepoint.* > sharepoint.portalserver.development > 02/2005

 #1  
02-04-05, 08:51 PM
Preston Park
I'm getting the "A Web Part ... cannot be displayed or imported because it is
not registered on this site as safe." error when trying to add a web part I
developed and I'm hoping someone can give me some ideas.

I compiled the web part and put it in a CAB using Visual Studio 2003 and
deployed using stsadm. I've tried using more or less of the namespace in the
dwp and web.config files with no luck.

The assembly name is SSRTestLibrary and the full class name is:

SWMED.CIS.TestLibrary.SSRList

Here are the relevent file snips

dwp file:
----------

<WebPart xmlns="http://schemas.microsoft.com/WebPart/v2" >
<Title>SSR List</Title>
<Description>SSR Selection List</Description>
<Assembly>SSRTestLibrary</Assembly>
<TypeName>TestLibrary.SSRList</TypeName>
<!-- Specify initial values for any additional base class or custom
properties here. -->
</WebPart>

web.config:
-------------
<SafeControl Assembly="SSRTestLibrary,
Version=1.0.0.0,
Culture=neutral,
PublicKeyToken=206b470c9c36637a"
Namespace="SWMED.CIS.TestLibrary"
TypeName="*"
Safe="True" />

What did I do wrong?

pjp
 #2  
02-05-05, 06:19 AM
Wei-Dong XU [MSFT]
Hi Preston,

After reading your web.config file and dwp file, I found that Namespace
attribute of the safecontrol element has the value
"SWMED.CIS.TestLibrary".
<SafeControl Assembly="SSRTestLibrary,
Version=1.0.0.0,
Culture=neutral,
PublicKeyToken=206b470c9c36637a"
Namespace="SWMED.CIS.TestLibrary"

So I'd suggest you can specify the full class name in the <type> node of
the dwp file:
<WebPart xmlns="http://schemas.microsoft.com/WebPart/v2" >
<Title>SSR List</Title>
<Description>SSR Selection List</Description>
<Assembly>SSRTestLibrary</Assembly>
<TypeName>SWMED.CIS.TestLibrary.SSRList</TypeName>

Please feel free to let me know if any question.

Best Regards,
Wei-Dong XU
Microsoft Product Support Services

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
================================================== ===
Business-Critical Phone Support (BCPS) provides you with technical phone
support at no charge during critical LAN outages or "business down"
situations. This benefit is available 24 hours a day, 7 days a week to all
Microsoft technology partners in the United States and Canada.
This and other support options are available here:
BCPS:
https://partner.microsoft.com/US/tec...rview/40010469
Others: https://partner.microsoft.com/US/tec...pportoverview/

If you are outside the United States, please visit our International
Support page:
http://support.microsoft.com/default...rnational.aspx.
================================================== ===
Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
 #3  
02-07-05, 05:01 AM
Amar Galla
Hi Preston,

To my knowledge, to deploy a webpart using stsadm, you will need to have
a proper manifest.xml file in the cab file along with your dwp file and the
webpart dll. Also incorporate the namespace changes Wei-Dong suggested
above.
 #4  
02-07-05, 05:25 PM
Preston Park
I already tried that but at least this tells me I was on the right track. I
finally just copied all of my code into a new project and managed to get the
web part installed. I must have missed something in the original project but
I have no dea what it was.

Thanks,

pjp

"Wei-Dong XU [MSFT]" wrote:
[..]
 #5  
02-08-05, 03:11 AM
Wei-Dong XU [MSFT]
You are welcome!

Best Regards,
Wei-Dong XU
Microsoft Product Support Services

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
================================================== ===
Business-Critical Phone Support (BCPS) provides you with technical phone
support at no charge during critical LAN outages or "business down"
situations. This benefit is available 24 hours a day, 7 days a week to all
Microsoft technology partners in the United States and Canada.
This and other support options are available here:
BCPS:
https://partner.microsoft.com/US/tec...rview/40010469
Others: https://partner.microsoft.com/US/tec...pportoverview/

If you are outside the United States, please visit our International
Support page:
http://support.microsoft.com/default...rnational.aspx.
================================================== ===
Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
Similar Threads
A Web Part or Web Form Control on this Web Part Page cannot be displayed or imported because it is not registered on this site as safe.

I get this error when I open a list view in Sharepoint portal server 2003: "A Web Part or Web Form Control on this Web Part Page cannot be displayed or imported because it...

A Web Part or Web Form Control on this Web Part Page cannot be displayed or imported because it is not registered on this site as safe.

Development Environment: I am developing using Visual Studio 2005 .NET 2.0. Sharepoint portal server 2003 is sitting on a different box. I'm starting simple and have a Wep...

Trying to register a Web Part as safe when my Project Server resides on a different server

I keep getting the Web Part is not registered as Safe message when trying to drag and drop my web part on my web part page and I have tried everything from all the articles. ...

Register web part as safe (episode II

I have a web part and cab project. When I install it using stsadm without the -globalinstall flag, I can add the web part to a page but it cannot get all of the permissions...

a web part of web form control on this web part page ...is not registered on this site as safe

Hi All I followed these steps to ensure the web part is safe: 1. The assembly has to have a strong name. You need the strong name tool (sn.exe), which you can find...


All times are GMT. The time now is 03:16 AM. | Privacy Policy