Thursday, December 27, 2007

Deploying WebParts in SharePoint 2007

Hi Folks,
Any SharePoint Development requires you to develop your Web Part and deploy it to sharePoint,in this post i will describe the steps required to deploy your web part to sharepoint 2007 site:

1) after creating your web part,you have to sign it with strong name.
To Do that : simply open the project properties and on the signing tab select new and then save the properties ad build your web Library.

2) add to the GAC on your sharePoint Server.
you can do that by using VS.Net Command tools or use .Net 2.0 configuration Tool from the control panel.

NOTE: after you add your DLL to GAC you can find it on C:\Windows\Assembly Folder.

Take Note : you have to store the Publick Key token of the signed DLL by right click on your DLL -> Properties and save the public key token on a notepafe file because it will be used later.

























3) To add this webpart to a sharepoint site,you have to make it "Safe Control " to be loaded and configured on your site.


To Do that : open the web.config file of your site,it resides on C:\IntePub\WWroot\WSS\Virtual Directories


then open the folder of your site,it takes by default the port number of your site.

Paste this code on the web.config : (i removed <> letters of the key)

SafeControl Assembly=”ArafaWebPart,
Version=1.0.0.0, Culture=neutral,
PublicKeyToken=2e128026f9c7d6df”
Namespace=”ArafaWebPart” TypeName=”*”

Safe and close your web.config.

4) open your sharepoint site->site settings->web parts->click on new and select your webpart and then click on Populate Gallery.














5) then click on any page and add your web part.













Hope this helps.




Regards,
Moustafa arafa

4 comments:

david santos said...

I wish you a good end of 2007 and a good year of 2008.

Moustafa El-Zoughby said...

Thanks David and happy new year.

Moustafa El-Zoughby said...

Hi All,

if you don't go deploy your web part manually as mentioned on my post,simply install VS 2005 Extensions for WSS 3.0.

and it gives you the ability to develop your web parts and deploy it without any line of code.

To Deploy the web part :
In Visual Studio 2005, press F5 to install the SharePoint solution and deploy it to one of your extended IIS Web applications. Use the Debug tab to specify to Visual Studio where you want to list the Web Part as an activated feature.

then,go to your site and add your web part in your page.

Hope this helps.

download url :

http://www.microsoft.com/downloads/details.aspx?familyid=19F21E5E-B715-4F0C-B959-8C6DCBDC1057&displaylang=en

Sagar said...

Guys,

Is there any way to deploy the web parts with accessing the server.

Thanks
-SM