~ YESChandana ~

The more I know, I know how little I know…!

  • If you are frequently updating the Assembly, then you always better to deploy it in BIN.  Since, Assembly will be reloaded automatically just after the updating.    But when you update the Assembly in GAC, you have to restart the IIS (IISRESET) to grab the new version. The reason is GAC keeps the assembly in Cache.
  • When you deploy your Assembly on GAC then you can access the Assembly from any SharePoint web application. But when you deploy Assembly in web application’s BIN folder, then it can only access from the given web application. Anyway, if you have all-purpose web part, you better to deploy it in GAC and avoid the multiple Assembly deployments in BIN. 
  • If you have multiple versions of same Assembly, then you have to deploy it in GAC. Coz, GAC manages the multiple version of given Assembly, but BIN doesn’t.
  • The next point is CAS (Code Access Security). When you deploy your Assembly in GAC, then CAS permission level is FULL by default. But when you deploy the Assembly in BIN [partially trusted location], the CAS level will be very low [wss_minimaltrust.config]; anyway you can manage the CAS level by through Web.Config. 
Further, I will come with another post about CAS in Web Parts.

If you have attended to yesterday (4th September 2008) Joy’s session in CDNUG monthly meeting, you may heard about Best Practices in developing Web Parts. Yes, as a one point he clearly mentioned that not use HTML tags directly in Web Part’s rendering. Here I am going to add something by showing how to write out proper HTML in Web Parts.


What will happen if I write the code like above? Nothing, it will work properly as long as HTML is correct. Then, what is the sense?  Fine… these are the point to say that is not good.

  • Yes, I know you can write minimum code with first approach. But is it readable? Noh... Actually it is not.
  • It is not maintainable code. Just think you want to add another row for HTML table. Then you have to check each HTML tag to find the exact position.
  • Error prone. For an example if you mistakenly forget to put HTML close tag, then it will affect to whole page that web part is running. And also, it may affect to another web part in your page or syndication generation.

If you check the below code, you can understand the difference.  I know it may take little bit of your time. But end of the day you have well written peace of code. Maintainability, fine HTML, etc... Everything is there…  Smile


free web stats