Before we add our custom webpart to the site we need to deploy the assembly of custom webpart to the BIN directory of Sharepoint site( in which we are going to use this webpart) or GAC.
What is the difference in Deploying the Assembly to GAC or BIN of the site directory?
To GAC (Global Assembly Cache):
1.If we place our signed dll in GAC it will get full trusted levels by default.
2.And also it get deployed globally so that it can be used in many applications.
1.No site level security(Not to particular site).
2.If any changes made to assembly or rebuilt the assembly we need to force WSS to reload the assembly by restarting the ISS.
To BIN Directory:
1. If we place the assembly in BIN directory , it is specific to that particular webapplication only.
2. By default this assembly run with partials security and low level CAS (Code Access Security)
3. Administrator can set the required CAS permission levels.For more information : see
Securing Web Parts in Windows SharePoint Services
1.In order to use the assembly across multiple sites this way will not work .We need to place the assembly in GAC.