https://bugzilla.novell.com/show_bug.cgi?id=639532
https://bugzilla.novell.com/show_bug.cgi?id=639532#c0 Summary: Should throw BadImageFormatException instead of DllNotFoundException Classification: Mono Product: Mono: Runtime Version: 2.6.x Platform: Other OS/Version: Other Status: NEW Severity: Normal Priority: P5 - None Component: misc AssignedTo: [email protected] ReportedBy: [email protected] QAContact: [email protected] Found By: --- Blocker: --- User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.2; en-GB; rv:1.9.2.9) Gecko/20100824 Firefox/3.6.9 ( .NET CLR 3.5.30729; .NET4.0E) In MS.NET if you try to call unmanaged code via DllImport to a foo.dll file, and the file is there but it's corrupt or cannot be loaded, the output is: Unhandled Exception: System.BadImageFormatException: An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B) at Test.MainClass.hello() at Test.MainClass.Main(String[] args) in C:\Documents and Settings\andres\My Documents\Test\Main.cs:line 19 However Mono outputs: Unhandled Exception: System.DllNotFoundException: foo.so at Test.MainClass.hello() at Test.MainClass.Main(String[] args) in C:\Documents and Settings\andres\My Documents\Test\Main.cs:line 19 Reproducible: Always This is very confusing because the user that is using Mono may think that Mono is not finding the DLL, trying to look for docs about working directory, LD_LIBRARY_PATH, etc... -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA contact for the bug. You are the assignee for the bug. _______________________________________________ mono-bugs maillist - [email protected] http://lists.ximian.com/mailman/listinfo/mono-bugs
