Tuesday, June 26, 2007

Deploy WSS 3.0 Web Part

Hi Folks,

This post i will explain how can you dpeloy a wss 3.0 webpart to your shareporint server.

the steps as follows:

1) on your class library,open project properties.
2) select signing tab.
3) check sign assembly check box and select new,and give your snk file a proper name , Close and save.

You will notice that a new snk file has been added to your solution which is used to sign your assembly and give it a strong name.

4) Dont forget to build the dll to be signed with the created strong file name.
5) add your strong name assemly to the GAC using VS command line

GacUtil -i MyAssembly.dll

You can check that the file assemly has been imported to GAC y navigating to :
C:\Windows\assembly

you will find your dll,this means that your string name dll has been imported successfully to GAC (Global Assembly Cache)

6) Right click on your srong name assembly and select properties,and copy the public token.

7) Create a manafiset file in your project "Manifest.xml"

8) Paste the public token you have saved to the PublickKeyToken attribute under safeControls element in Manifest.xml file.

9) Manifest.xml file should be Content file on the build action property on VS.

on the above steps,your web part is ready to be packaged up to the shareporint server,to create the cab file of this webpart do the following:

10) add a new project, Cab Project.
11) add the primary output / content files to the Cab Project.
12) Build the CaB Project.
13) after building the CAB Project,Rename it to wsp (SharePoint solution file).
14) Take this file (wsp) and insert it using SBS admin tools :
stsadmin -c addsolution -filename MyWebPartCab.wsp

15) On Solution Management on SharePoint Central administration site, you will see the imported solution file which oyu have did on the previous step.

16) Select the solution and click on Deploy Button.


Now you have finished deploying your webpart and you can add it to any web application in your WSS Sites.

Add our webpart to your site on any webpart page,if you didnt find it,add it by clicking on new button on the web parts gallery list.


Hope this helps and descriptive.

Regards,
Moustafa arafa

7 comments:

Brian said...

Hey Moustafa,

I am using the visual studio sharepoint extensions. While this was great for developing and deploying on my development server, I am at a loss as to how to deploy this webpart on our production server.

I remember wss2.0 all you had to do was make a cab file with the primary output and content files of the webpart. Then you ran stsadm.

It was great because you didn't have to sign assemblies, copy any files, edit web.config or mess around with manifest.xml.

Is this deployment option still available?

Moustafa El-Zoughby said...

Hi Brian,

Thanks for the comment,i think this is the only way to package our WSS 3.0 Web Part;packaging for the wss 2.0 WP is different than i have version 3.0 WP.

let me know if there is an easier way to do that :)

Brian said...

It's me again,

I've spent the last week working out everyway to package and deploy webparts. I am mostly happy with what I've got. The nice thing is that the webparts show up as site collection features.

I didn't see a feature.xml file used in your method. Does this mean it isn't considered a feature?

Moustafa El-Zoughby said...

Hi Brian,

Thanks alot for your contribution on my blog,i hope my blog be attractive for you usual.

For your question : The Answer is This is not considered as a feature.

Rod said...

This way is a nice easy way for beginners I think:
http://roddotnet.blogspot.com/2007/09/deploying-wss-30-web-parts-easily-to.html

unless I am confused. Thanks for your guide though - everyone should read and understand what work goes behind the scenes.

Oleksandr said...

Instead of doing steps 5 and 6 you can use sn.exe:
sn -T WebPartLib.dll
this will show you public key token without installing .dll into GAC.

Moustafa El-Zoughby said...

thanks