Prev: Why is my GetFields(BindingFlags.Instance | BindingFlags.Public)not working? (Sample working code included)
Next: Filtering a MS Access Dataset
From: Peter on 11 Jun 2010 12:48 Hi I test dynamic loading of Assemblies for a "plugin Design". (define Assembly-Names in Config-File, loading this Assemblies from Host-Application...) To check serious rule violations (my own rules) i declare a AssemblyLoadEvent in current AppDomain. If a Assembly ist "not according to my wish" I will cancel the Application throwing a Exception The Problem is that an Exception from the AppDomain.AssemblyLoad- EventHandler disappears into nowhere. AppDomain.CurrentDomain.AssemblyLoad += new AssemblyLoadEventHandler(CurrentDomain_AssemblyLoad); void CurrentDomain_AssemblyLoad(object sender, AssemblyLoadEventArgs args) { //test the Loaded assembly here if ( >not according to my wish< ) throw new Exception ("Invalid Assembly...") // this exception disappears into nowhere } p.s. i already tested if the Main-Main and the CurrentDomain_AssemblyLoad- Thread are equal, they are. Thank you Peter |