Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=54202
I don't have a Windows 7 VM available to test (and I don't see them on Win11), but this should hopefully prevent the crash dialogs from popping up.
From: Esme Povirk esme@codeweavers.com
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=54202 --- dlls/mscoree/tests/loadpaths.exe.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/dlls/mscoree/tests/loadpaths.exe.cs b/dlls/mscoree/tests/loadpaths.exe.cs index 22c32603c59..5d4806ddbfc 100644 --- a/dlls/mscoree/tests/loadpaths.exe.cs +++ b/dlls/mscoree/tests/loadpaths.exe.cs @@ -16,13 +16,21 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */
+using System; + namespace LoadPaths { public static class Test { static int Main(string[] args) { - return new Test2().Foo(); + try { + return new Test2().Foo(); + } + catch (Exception e) { + Console.WriteLine(e); + return 1; + } } } }
Still crashes on w7pro64 (64-bit exe): https://testbot.winehq.org/JobDetails.pl?Key=136810&s901=1#k901
(I'm not knowledgeable enough on mscoree so I don't know if this is actually testbot/CI problem or not.)
A StackOverflow post[^so] says `TypeLoadException` is thrown *before* the method body is even executed. Maybe you want a separate method, or even an own class?
[^so]: https://stackoverflow.com/questions/3346740/typeloadexception-is-not-caught-by-try-catch
Oh, thanks, I didn't realize you could check that way.
I'll try that.