* Kornel Pal <http://www.kornelpal.hu/>
*
* Copyright (C) 2008 Kornel Pal
+ * Licensed under the MIT license. See LICENSE file in the project root for full license information.
*/
#include <config.h>
#include "domain-internals.h"
#include "appdomain.h"
#include "object.h"
+#include "object-internals.h"
#include "loader.h"
#include "threads.h"
#include "environment.h"
MonoMethod* method;
guint32 entry;
gchar* file_name;
- gchar* error;
+ gchar* corlib_version_error;
int argc;
gunichar2** argvw;
gchar** argv;
init_from_coree = TRUE;
domain = mono_runtime_load (file_name, NULL);
- error = (gchar*) mono_check_corlib_version ();
- if (error) {
- g_free (error);
+ corlib_version_error = (gchar*) mono_check_corlib_version ();
+ if (corlib_version_error) {
+ g_free (corlib_version_error);
g_free (file_name);
MessageBox (NULL, L"Corlib not in sync with this runtime.", NULL, MB_ICONERROR);
mono_runtime_quit ();
argv [i] = g_utf16_to_utf8 (argvw [i], -1, NULL, NULL, NULL);
LocalFree (argvw);
- mono_runtime_run_main (method, argc, argv, NULL);
+ mono_runtime_run_main_checked (method, argc, argv, &error);
+ mono_error_raise_exception (&error); /* OK, triggers unhandled exn handler */
mono_thread_manage ();
mono_runtime_quit ();