The application domain in which the thread was running has been unloaded.

This error occurs when we try to run a web site application which is configured in IIS and the physical path of the web site is either removed or changed.
 
To fix the error, go to IIS Manager-Sites-Default Web Site->Manage Web Site-Advanced Settings. Set the Physical path e.g
d:\Projects\MyProject\MyProject.UI