Unloading Assemblies in C#

Updated 8/29/2018 - Formatted
If you've created an Application Domain and want to unload all the assemblies loaded within, there is no way to unload Assembly themselves. But you can unload the Application Domain you've just created.
In addition to that one;
You cannot unload the default Application Domain CLR created on its own. And unloading can differ from the assemblies being used and the unload events these assemblies have. It can take some time.
To Unload an Application Domain all you need to do is calling the Unload function.
A sample code can help you understand:
  1. AppDomain myDom=AppDomain.Create("Ibrahims Domain");  
  2. //Here assuming you loaded your assemblies  
  3. //To unload AppDomain call Unload Function  
  4. AppDomain.Unload(myDom);  
  5. // The Application Domain we've just created is now no more as the assemblies with it.  
After Unloading the Application Domain object, we've also unloaded all the assemblies loaded within.