+2006-11-09 Raja R Harinath <rharinath@novell.com>
+
+ * driver.cs (BadAssembly): Handle all the ugliness of
+ DefineDynamicAssembly.
+
2006-11-08 Raja R Harinath <rharinath@novell.com>
Address parts of #58244 -- most of what's left is in the runtime
AssemblyName an = new AssemblyName ();
an.Name = ".temp";
AssemblyBuilder ab = AppDomain.CurrentDomain.DefineDynamicAssembly (an, AssemblyBuilderAccess.Run);
- if (adder_method.Invoke (ab, new object [] { filename }) != null) {
- Report.Error (1509, "referenced file `{0}' is not an assembly; try using the '-addmodule' option", filename);
- return;
+ try {
+ object m = null;
+ try {
+ m = adder_method.Invoke (ab, new object [] { filename });
+ } catch (TargetInvocationException ex) {
+ throw ex.InnerException;
+ }
+
+ if (m != null) {
+ Report.Error (1509, "referenced file `{0}' is not an assembly; try using the '-addmodule' option", filename);
+ return;
+ }
+ } catch (FileNotFoundException) {
+ // did the file get deleted during compilation? who cares? swallow the exception
+ } catch (BadImageFormatException) {
+ // swallow exception
+ } catch (FileLoadException) {
+ // swallow exception
}
}
Error9 ("assembly", filename, log);