Hello experts,
I've been tasked with setting up some web parts so that our marketing dept can do whatever with the apps we write, but I've hit a snag.
As with any new task, I start with the easy one.
So I followed the instructions that Suraj Poozhiyil (
http://www.sharepointcustomization.com/resources/demos.htm ) from Microsoft shows to just build a simple Hello World web part.
Got the template in VS.Net, loaded in C# and VB (but I'm using C#)
Create the web part library, rename it to MyHelloWorld
Change output.Write(SPEncode.Html
Encode(Tex
t)); to output.Write('Howdy World");
Change the output directory to the bin directory on my sharepoint site (I have sharepoint and vs.net on the same box...and I have some confusion on this, as I'm not a share point guy...not sure I have the right directory...in IIS it shows my _vti_bin to be C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\60\isapi which also has bin directory one step down, I have tried both of those and the inetpub\wwwroot\bin directory to no avail)
Build the app.
Go into sharepoint, edit page, import and browse to my MyHelloWorld.dwp, hit upload and then it displays on the tool bar.
However, when I try and drag it on the page I get "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."
According to the demo I watched...I did everything as told...so I dug a little further.
Using SA.exe I strongly named my assembly, dragged it to c:\windows\assembly got the key from the properties
edited my web.config file (the one in the home directory for my sharepoint site) with <SafeControl Assembly="MyHelloWorld, Version=1.0.0.1, Culture=neutral, PublicKeyToken=6b6979e152d
8c840" Namespace="HelloWorldWebPa
rt" TypeName="*" Safe="True" />
copied keypair.snk to the root of C: (and all 3 bin directories) and changed my assembly.cs to show c:\\keypair.snk for the location.
ever after all of this...still getting "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."
What am I missing?
Thanx in advance,
Brian