Procedure:
- Build your Web Part with Strong Name: Create a ClassLibrary Project.
- Drag and Drop the CustomWebPart.dll to GAC (C:\Windows\Assembly).
- Open the VirtualDirectories Folder (C:\Inetpub\wwwroot\wss\VirtualDirectories) and go to the Root Folder of your site. ( For Example your site is "http://localhost:801/sites/TestSite", then open the folder "801".)
- Open web.config file and add an SafeControl entry for your web part like,
(Note: PublicKeyToken can be copied from GAC). - Reset IIS
- Go to your site and Click on "Site Settings" => "Web parts".
- Click on "New" web part and Select your Web part and click on "Populate Gallary".
- Now go to your site and click on edit page. Click "Add a Web part". Select your web part under "Miscellaneous" section and click on "Add".
- You can see your web part now.
- Build your Web Part with Strong Name: Create a ClassLibrary Project.
- Drag and Drop the CustomWebPart.dll to GAC (C:\Windows\Assembly).
- Add "CustomWepPartCab" cab project to the above solution(File => New => Project => Other Project Types => Setup and Deployment Project => Cab Project => "CustomWepPartCab")
- Add "Project Output.." by right click on cab project.
- Select "Primary output" and "Content Files".
Note: Please make sure that file name(manifest.xml) is not changed
"
7. Add another file with name "CustomWebPart.dwp", the name given in the maifest.xml file as follows:
"
Deploying the Cab file:
- Go to command prompt(Start => Run => Cmd)
- Change the directory to the location where cab file(CustomWebPart.cab) is build.
- Execute the following command
- stsadm.exe -o addwppack -filename WebPartCab.CAB -url http://SiteUrltoInstallWebPart -globalinstall -force
No comments:
Post a Comment