RE: Web Part Unsafe
- From: "Daniel Larson (www.portalbuilder.org)" <daniel@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Sun, 27 Nov 2005 18:37:04 -0800
Hey Chris,
Try this: DON'T strong name your assembly, remove the old dll from the GAC,
put the dll in the BIN directory, use a simple entry in web.config (
<SafeControl Assembly="hello" Namespace="Hello" TypeName="*" Safe="True" /> )
-- make sure the casing is correct-- and use /_layouts/1033/newdwp.aspx to
create your DWP.
For WSS development, have you considered using a Visual Studio Express
version (which would also require WSS SP2 running on ASP.NET 2.0)? (BTW-- at
this time, MS only recommends this for WSS development, not SPS).
Daniel Larson
"Chris" wrote:
> I have an assembly called hello_sn.dll. I register it in the GAC with the
> ..net configuration tool. I add an entry to the webconfig in the wwwroot. I
> then create my dwp and upload it to the default site. When I go to import I
> get an error saying the web part is unsafe. What I am doing wrong? This
> version of win2003 is out of the box and this the fiirst thing I have tried
> on it so there may be configuration issues. Where am I going wrong??
> Regards, Chris. The only unusual thing is I didn't create the dll with the
> web template as I can't afford VS.net. I compiled it as a module with
> vbc.exe and then used al.exe to assign the strong key and version
> information. I don't think it is that as I wouldn't be able to install it to
> the GAC.
>
> Web Config Entry
> <SafeControl Assembly="hello_sn, Version=1.0.0.0, Culture=neutral,
> PublicKeyToken=c28f363c7292dd31" Namespace="Hello" TypeName="*" Safe="True"
> />
>
>
> DWP
> <WebPart xmlns="http://schemas.microsoft.com/WebPart/v2" >
> <Title>My Web Part 1</Title>
> <Description>The first web part I created.</Description>
> <Assembly>hello, Version=1.0.0.0, Culure=Neutral,
> PublicKeyToken=c28f363c7292dd31</Assembly>
> <TypeName>Hello.HelloWebPart</TypeName>
> <!-- Specify default values for any additional base class or custom
> properties here. -->
> </WebPart>
>
>
> Source Code
> namespace Hello
>
> public class HelloWebPart
>
> Inherits Microsoft.SharePoint.WebPartPages.WebPart
>
> Protected Overrides Sub RenderWebPart(ByVal Output as
> System.Web.UI.htmlTextWriter)
>
> output.write("my first web part")
>
> End Sub
>
> End Class
>
> End Namespace
>
>
>
>
.
- Prev by Date: RE: Adding Web Parts Programmatically... problemette...
- Next by Date: Re: WebPart with VS2005
- Previous by thread: Re: Web Part Unsafe
- Next by thread: SPUser.LoginName returning old name
- Index(es):
Relevant Pages
|