Wednesday, February 01, 2006
How to manually install a SharePoint web part when you have only the DLL and DWP files
When I posted my Gantt chart web part, some people asked for more guidance on how to deploy web parts that don't come with an installer. In my opinion, a professional web part should come with an installer, but sometimes people post samples or demos and don't have the time (or motivation) to build an installer for you and you are stuck with a DLL file and a DWP file. This post describes how you get it to work.
Prerequisites
- You must be administrator on the server running Windows SharePoint Services (WSS)
- You must have a working version of WSS running, obviously
Placing the files in the right folders
You will have downloaded a ZIP file containing at the very least a DLL file and a DWP file. These two files are the bare necessities for installing your web part. In a default WSS installation, you will have a folder C:\Inetpub\wwwroot\wpcatalog. Place the DWP file in this folder. Place the accompanying DLL file in the C:\Inetpub\wwwroot\bin folder.
The new web part will now appear in the catalog when you browse for new web parts, but you have to change some settings before you actually use it.Trusting the part
By default, SharePoint will distrust all DLLs that are placed in its folders. We have to tell SharePoint that our specific web part can be trusted. To achieve this, you open the web.config file in the C:\Inetpub\wwwroot folder. This is an XML file and you must be very careful editing it: when your edit results in invalid XML, the whole WSS system will stop working (if you have no idea what invalid XML is, this post is not for you). Also: every time you save the web.config file, the web server will restart itself (the AppDomain, really). Don't do this casually on a production system. Remember to make a backup of the old web.config. In the XML file, you will find a section <safecontrols> that contains a list of trustworthy web parts. Normally, the web part author will provide you with a snippet that should be added to the list.
Once the web.config is updated, your web part should be ready to roll. Some web parts may need additional steps, but these will then be described in detail by the part's author.
Labels: sharepoint
I'm sorry, but you really need access to the server as an admin. The feature contains executable code and must be installed on the server.
Links to this post:
<< Home



