Tuesday, December 30, 2008

Loading & Unloading Assemblies from GAC on runtime


Recently we developed a tool for Inspecting whether the system has the required components for Silverlight SharePoint Integration.
This tool provides a checklist of things which are required & not installed on the users system and then allow the user to install them and re-run the Inspection.

The tricky part was to re-run the inspection for the assemblies in GAC. We were using the Assembly.Load method to dynamically load the assemblies from GAC and than just have a null check against it.
But the issue was that once we load the assemblies it doesn't allow to unload it. Which means that this would not work as expected when we try to re-run the inspection and try to re-load the same assembly within the same application domain.

The solution was to create a separate application domain and than load the assembly in that appdomain and than unload the appdomain once used.

Here is a sample code of the Inspection button click :

image

Wednesday, December 03, 2008

Creating a Tag Cloud in Silverlight


For one of our Data Visualization projects I wanted to create a Tag Cloud type UI in Silverlight. Googling around I found this very nice article on this.

I decided to reproduce the user control so I could learn more about Silverlight and also added few customizations and some mouse enter and leave events to highlight the selected tag.
I also made some other small modifications to clean up the code a bit.

Here is the screen of the control :

tagcloud

You can download the source code from here.

AddIn