Re: Web part not safe even if using stsadmin tool

From: Robert Bogue ([*]rbogue[spam]crowechizek[spam]com)
Date: 09/29/04


Date: Wed, 29 Sep 2004 05:12:59 -0500

I've seen the same error when a dependent assembly wasn't loaded or wasn't
trusted. Have you tried firing up your DLL in Reflector?

-- 
Robert Bogue
Microsoft MVP Server-Networking
MCSE(NT4), MCSE (W2K), MCSA:Security (W2K), CNA, A+, Network+, IT Project+,
Server+, Security+, CDIA+, E-Biz+
Crowe Chizek and Co LLC
"Ted Callander" <mspubsppsdev@callander.se> wrote in message
news:1f9a01c4a4a3$4a4e81a0$a501280a@phx.gbl...
> I have a problem with marking my web part as safe. I have
> created a strongly named assembly which i have put in a
> CAB file together with a manifest.xml and a dwp file. I
> then use STSADMIN tool to import it into the web part
> gallery, using -globalInstall so that it is put in the
> GAC. So far no problem, but when i try to use it on a
> page:
> "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 have checked and it is present in web.config. I can't
> see what is wrong. Below is the contents of my files. Any
> help regarding this would be really appreciated!
>
> ---- JupiterWP2.vb ----
> Imports Microsoft.SharePoint.WebPartPages
> Imports System.Web
> Imports System.Web.UI
> Imports System.Reflection
> <Assembly: AssemblyKeyFileAttribute("tckey.snk")>
> <Assembly: AssemblyVersion("1.0.0.0")>
> Namespace JupiterWP2
>   Public Class JupiterWP : Inherits WebPart
>     Protected Overrides Sub RenderWebPart(Output as
> HtmlTextWriter)
>       Output.Write("Hello, World")
>     End Sub
>   End Class
> End Namespace
>
> ---- JupiterWP2.dwp ----
> <?xml version="1.0" encoding="utf-8"?>
> <WebPart xmlns="http://schemas.microsoft.com/WebPart/v2" >
>     <Title>Jupiter WP 2</Title>
>     <Description>Jupiter Web Part</Description>
>     <Assembly>JupiterWP2</Assembly>
>     <TypeName>JupiterWP2.JupiterWP</TypeName>
> </WebPart>
>
> ---- Manifest.xml ----
> <?xml version="1.0"?>
> <WebPartManifest
> xmlns="http://schemas.microsoft.com/WebPart/v2/Manifest">
>   <Assemblies>
>   <Assembly FileName="JupiterWP2.dll">
>     <SafeControls>
>     <SafeControl Namespace="JupiterWP2"
> TypeName="*" />
>     </SafeControls>
>   </Assembly>
>   </Assemblies>
>   <DwpFiles>
>   <DwpFile FileName="JupiterWP2.dwp"/>
>   </DwpFiles>
> </WebPartManifest>
>
> ---- Found in web.config after installation ---
> <SafeControl Assembly="JupiterWP2, Version=1.0.0.0,
> Culture=neutral, PublicKeyToken=8e8a8702a12c15b6"
> Namespace="JupiterWP2" TypeName="*" Safe="True" />
>


Relevant Pages

  • Re: Transparent Label Control - Text Refresh Problem
    ... Whenever your control is painted it ... > Imports System.Windows.Forms.Design ... > 'Protected Overrides Sub OnLocationChanged ... > Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs) ...
    (microsoft.public.dotnet.framework.windowsforms)
  • Re: Transparent Label Control - Text Refresh Problem
    ... We have exactly the same problem with a transparent control we're working ... I am investigating some deep designer ... > Imports System.Windows.Forms.Design ... > 'Protected Overrides Sub OnLocationChanged ...
    (microsoft.public.dotnet.framework.windowsforms)
  • Re: Simple composite control fires event fires first time but not second
    ... Protected Overrides Sub createchildcontrols() ... Dim _SearchTerm As New TextBox ... Imports System.Collections.Specialized ...
    (microsoft.public.dotnet.framework.aspnet.webcontrols)
  • Re: :o( .... Cant make a simple composite control work
    ... you basically instantiate a local generic array in CreateChildControls ... > I'm playing around with creating composite controls. ... > Imports System.Collections.Generic ... > Protected Overrides Sub RenderContents ...
    (microsoft.public.dotnet.framework.aspnet.webcontrols)
  • Creating Meshes Manually
    ... Imports System.Drawing ... Private WithEvents target As System.Windows.Forms.PictureBox = ... Protected Overrides Sub Render() ... Protected Overrides Sub RestoreDeviceObjects(ByVal sender As ...
    (microsoft.public.win32.programmer.directx.managed)