[Pkg-mono-svn-commits] [SCM] mono branch, master-experimental, updated. debian/2.6.3-4-34-gd1bf954

Mirco Bauer meebey at meebey.net
Thu Aug 12 01:17:15 UTC 2010


The following commit has been merged in the master-experimental branch:
commit 665316e3fe5fcc613bf7ba81d33c05004889d7cf
Author: Mirco Bauer <meebey at meebey.net>
Date:   Mon Aug 2 16:01:15 2010 +0200

    Imported Upstream version 2.6.7

diff --git a/ChangeLog b/ChangeLog
index e3fa28b..cf6dd5f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,80 @@
+2010-07-12  Andrew Jorgensen  <ajorgensen at novell.com>
+
+	* mono-core.spec.in: Updates, including breaking a circular dep.
+
+2010-04-26  Zoltan Varga  <vargaz at gmail.com>
+
+	* configure.in: Applied patch from Robert Nagy (robert at openbsd.org). Add
+	sys/param.h dependencies to a few checks.
+
+2010-04-21  Andrés G. Aragoneses  <andres at lindenlab.com>
+
+	* configure.in: Propagate DISABLE_MCS_DOCS to makefiles so mono/docs
+	can be disabled. Fixes the build '--with-profile2=no' using
+	'--with-mcs-docs=no' as a workaround.
+
+2010-04-20  Jonathan Pryor  <jpryor at novell.com>
+
+	* configure.in: Check for the asm/sigcontext.h header.
+
+2010-04-20  Jonathan Pryor  <jpryor at novell.com>
+
+	* configure.in: On OpenBSD, remove duplicate -pthread options in 
+	  libmono_ldflags.  Change from Robert Nagy <robert at openbsd.org>.
+
+2010-04-20  Jonathan Pryor  <jpryor at novell.com>
+
+	* configure.in: For Linux hosts, remove AC_CHECK_LIB(pthread...) in the
+	  primary `case "$host"` block.  Using AC_CHECK_LIB() here breaks *BSD,
+	  and it's unnecessary (for !target_win32, pthreads are checked again 
+	  later in configure.in).
+
+2010-04-19  Jonathan Pryor  <jpryor at novell.com>
+
+	* configure.in: Use AC_CHECK_LIB() to check for pthread instead of
+	  just blindly linking to -lpthread, as Android includes pthread
+	  support within libc and doesn't provide a separate libpthread.
+	  Android's <string.h> pulls in <malloc.h> (unlike glibc), resulting
+	  in a build error in mono/utils/mono-codeman.c due to 
+	  `struct mallinfo` re-declaration.  Define HAVE_USR_INCLUDE_MALLOC_H 
+	  if /usr/include/malloc.h is present to avoid this.
+
+2010-04-19  Jonathan Pryor  <jpryor at novell.com>
+
+	* configure.in: Add header, structure member, and function checks as 
+	  Android doesn't provide all the headers, structure members, and 
+	  functions that a "full" Linux distro includes.
+
+2010-04-19  Zoltan Varga  <vargaz at gmail.com>
+
+	* configure.in: Add a --enable-minimal=normalization option to disable support
+	for string normalization.
+
+2010-04-05  Zoltan Varga  <vargaz at gmail.com>
+
+	* configure.in: Append -lgc to libmono_ldflags if using an external libgc.
+
+2010-04-04  Andreas Färber  <andreas.faerber at web.de>
+
+	* configure.in: Fix typo.
+	Set default for with_moonlight to fix "Moon Profile:" output.
+
+	Contributed under MIT/X11 license.
+
+2010-04-03  Zoltan Varga  <vargaz at gmail.com>
+
+	* configure.in: Applied some openbsd changes from Robert Nagy
+	<robert at openbsd.org>.
+
+2010-01-22  Zoltan Varga  <vargaz at gmail.com>
+
+	* configure.in: Check whenever g++ is installed, since libtool requires it
+	even if no c++ files will be compiled.
+
+2010-03-26  Zoltan Varga  <vargaz at gmail.com>
+
+	* configure.in: Apply some openbsd changes from openbsd ports.
+
 2010-01-22  Zoltan Varga  <vargaz at gmail.com>
 
 	* configure.in: Disable the solaris tar check on !solaris platforms.
diff --git a/config.h.in b/config.h.in
index 66e8855..0907bcf 100644
--- a/config.h.in
+++ b/config.h.in
@@ -36,6 +36,9 @@
 /* Disable support debug logging */
 #undef DISABLE_LOGGING
 
+/* Disable String normalization support. */
+#undef DISABLE_NORMALIZATION
+
 /* Disable P/Invoke support */
 #undef DISABLE_PINVOKE
 
@@ -87,6 +90,9 @@
 /* Supports C99 array initialization */
 #undef HAVE_ARRAY_ELEM_INIT
 
+/* Define to 1 if you have the <asm/sigcontext.h> header file. */
+#undef HAVE_ASM_SIGCONTEXT_H
+
 /* Define to 1 if you have the <attr/xattr.h> header file. */
 #undef HAVE_ATTR_XATTR_H
 
@@ -105,6 +111,9 @@
 /* Define to 1 if you have the <checklist.h> header file. */
 #undef HAVE_CHECKLIST_H
 
+/* Define to 1 if you have the `confstr' function. */
+#undef HAVE_CONFSTR
+
 /* Have /dev/random */
 #undef HAVE_CRYPT_RNG
 
@@ -123,6 +132,15 @@
 /* Define to 1 if you have the <elf.h> header file. */
 #undef HAVE_ELF_H
 
+/* Define to 1 if you have the `endgrent' function. */
+#undef HAVE_ENDGRENT
+
+/* Define to 1 if you have the `endpwent' function. */
+#undef HAVE_ENDPWENT
+
+/* Define to 1 if you have the `endusershell' function. */
+#undef HAVE_ENDUSERSHELL
+
 /* epoll supported */
 #undef HAVE_EPOLL
 
@@ -150,6 +168,9 @@
 /* Define to 1 if you have the `fstatvfs' function. */
 #undef HAVE_FSTATVFS
 
+/* Define to 1 if you have the `futimes' function. */
+#undef HAVE_FUTIMES
+
 /* Have GC_enable */
 #undef HAVE_GC_ENABLE
 
@@ -168,6 +189,9 @@
 /* Define to 1 if you have the `getfsstat' function. */
 #undef HAVE_GETFSSTAT
 
+/* Define to 1 if you have the `getgrent' function. */
+#undef HAVE_GETGRENT
+
 /* Define to 1 if you have the `getgrgid_r' function. */
 #undef HAVE_GETGRGID_R
 
@@ -177,12 +201,21 @@
 /* Have gethostbyname2_r */
 #undef HAVE_GETHOSTBYNAME2_R
 
+/* Define to 1 if you have the `gethostid' function. */
+#undef HAVE_GETHOSTID
+
+/* Define to 1 if you have the `getlogin_r' function. */
+#undef HAVE_GETLOGIN_R
+
 /* Define to 1 if you have the `getpriority' function. */
 #undef HAVE_GETPRIORITY
 
 /* Define to 1 if you have the `GetProcessId' function. */
 #undef HAVE_GETPROCESSID
 
+/* Define to 1 if you have the `getpwent' function. */
+#undef HAVE_GETPWENT
+
 /* Define to 1 if you have the `getpwnam_r' function. */
 #undef HAVE_GETPWNAM_R
 
@@ -240,9 +273,15 @@
 /* Define to 1 if you have the `unwind' library (-lunwind). */
 #undef HAVE_LIBUNWIND
 
+/* Define to 1 if you have the <link.h> header file. */
+#undef HAVE_LINK_H
+
 /* Define to 1 if you have the <linux/rtc.h> header file. */
 #undef HAVE_LINUX_RTC_H
 
+/* Define to 1 if you have the `lockf' function. */
+#undef HAVE_LOCKF
+
 /* Define to 1 if you have the `lutimes' function. */
 #undef HAVE_LUTIMES
 
@@ -285,6 +324,9 @@
 /* Have oprofile support */
 #undef HAVE_OPROFILE
 
+/* Define to 1 if you have the <pathconf.h> header file. */
+#undef HAVE_PATHCONF_H
+
 /* Define to 1 if you have the `poll' function. */
 #undef HAVE_POLL
 
@@ -300,6 +342,9 @@
 /* Define to 1 if you have the `posix_madvise' function. */
 #undef HAVE_POSIX_MADVISE
 
+/* Define to 1 if you have the `psignal' function. */
+#undef HAVE_PSIGNAL
+
 /* Define to 1 if you have the `pthread_attr_getstack' function. */
 #undef HAVE_PTHREAD_ATTR_GETSTACK
 
@@ -342,6 +387,9 @@
 /* Define to 1 if you have the `sched_setaffinity' function. */
 #undef HAVE_SCHED_SETAFFINITY
 
+/* Define to 1 if you have the `seekdir' function. */
+#undef HAVE_SEEKDIR
+
 /* Define to 1 if you have the <semaphore.h> header file. */
 #undef HAVE_SEMAPHORE_H
 
@@ -351,15 +399,30 @@
 /* Define to 1 if you have the `setdomainname' function. */
 #undef HAVE_SETDOMAINNAME
 
+/* Define to 1 if you have the `setgrent' function. */
+#undef HAVE_SETGRENT
+
+/* Define to 1 if you have the `setgroups' function. */
+#undef HAVE_SETGROUPS
+
 /* Define to 1 if you have the `sethostid' function. */
 #undef HAVE_SETHOSTID
 
+/* Define to 1 if you have the `sethostname' function. */
+#undef HAVE_SETHOSTNAME
+
 /* Define to 1 if you have the `setpriority' function. */
 #undef HAVE_SETPRIORITY
 
+/* Define to 1 if you have the `setpwent' function. */
+#undef HAVE_SETPWENT
+
 /* Define to 1 if you have the `setresuid' function. */
 #undef HAVE_SETRESUID
 
+/* Define to 1 if you have the `setusershell' function. */
+#undef HAVE_SETUSERSHELL
+
 /* Using the simple generational GC. */
 #undef HAVE_SGEN_GC
 
@@ -441,12 +504,18 @@
 /* Define to 1 if `kp_proc' is member of `struct kinfo_proc'. */
 #undef HAVE_STRUCT_KINFO_PROC_KP_PROC
 
+/* Define to 1 if `pw_gecos' is member of `struct passwd'. */
+#undef HAVE_STRUCT_PASSWD_PW_GECOS
+
 /* Define to 1 if the system has the type `struct pollfd'. */
 #undef HAVE_STRUCT_POLLFD
 
 /* Define to 1 if the system has the type `struct stat'. */
 #undef HAVE_STRUCT_STAT
 
+/* Define to 1 if `f_flags' is member of `struct statfs'. */
+#undef HAVE_STRUCT_STATFS_F_FLAGS
+
 /* Define to 1 if the system has the type `struct timespec'. */
 #undef HAVE_STRUCT_TIMESPEC
 
@@ -462,6 +531,9 @@
 /* Define to 1 if the system has the type `suseconds_t'. */
 #undef HAVE_SUSECONDS_T
 
+/* Define to 1 if you have the `swab' function. */
+#undef HAVE_SWAB
+
 /* Define to 1 if you have the <syslog.h> header file. */
 #undef HAVE_SYSLOG_H
 
@@ -555,6 +627,9 @@
 /* Define to 1 if you have the <sys/xattr.h> header file. */
 #undef HAVE_SYS_XATTR_H
 
+/* Define to 1 if you have the `telldir' function. */
+#undef HAVE_TELLDIR
+
 /* Define to 1 if you have the <termios.h> header file. */
 #undef HAVE_TERMIOS_H
 
@@ -582,6 +657,9 @@
 /* Define to 1 if you have the <unistd.h> header file. */
 #undef HAVE_UNISTD_H
 
+/* Define to 1 if you have /usr/include/malloc.h. */
+#undef HAVE_USR_INCLUDE_MALLOC_H
+
 /* Define to 1 if you have the <utime.h> header file. */
 #undef HAVE_UTIME_H
 
diff --git a/configure b/configure
index 05543a4..1644129 100755
--- a/configure
+++ b/configure
@@ -785,7 +785,9 @@ ac_includes_default="\
 #endif"
 
 enable_option_checking=no
-ac_subst_vars='LTLIBOBJS
+ac_subst_vars='DISABLE_MCS_DOCS_FALSE
+DISABLE_MCS_DOCS_TRUE
+LTLIBOBJS
 LIBOBJS
 mono_cfg_dir
 mono_runtime
@@ -1773,7 +1775,7 @@ Optional Features:
   --enable-quiet-build  Enable quiet runtime build (on by default)
   --enable-minimal=LIST      drop support for LIST subsystems.
      LIST is a comma-separated list from: aot, profiler, decimal, pinvoke, debug,
-     reflection_emit, reflection_emit_save, large_code, logging, com, ssa, generics, attach, jit, simd,soft_debug.
+     reflection_emit, reflection_emit_save, large_code, logging, com, ssa, generics, attach, jit, simd, soft_debug, normalization.
   --enable-parallel-mark     Enables GC Parallel Marking
   --disable-dev-random    disable the use of the random device (enabled by default)
   --disable-shared-handles disable inter-process shared handles
@@ -2745,7 +2747,7 @@ fi
 
 # Define the identity of the package.
  PACKAGE=mono
- VERSION=2.6.3
+ VERSION=2.6.7
 
 
 cat >>confdefs.h <<_ACEOF
@@ -3156,17 +3158,21 @@ _ACEOF
 		;;
 	*-*-*openbsd*)
 		platform_win32=no
-		CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE -DGC_FREEBSD_THREADS -DPLATFORM_BSD"
-		libmono_cflags="-D_THREAD_SAFE"
+		CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE -DGC_OPENBSD_THREADS -DPLATFORM_BSD -D_GNU_SOURCE -D_REENTRANT -DUSE_MMAP"
+		if test "x$disable_munmap" != "xyes"; then
+		CPPFLAGS="$CPPFLAGS -DUSE_MUNMAP"
+		fi
+		libmono_cflags="-D_THREAD_SAFE -D_REENTRANT"
 		LDFLAGS="$LDFLAGS -pthread"
-		libmono_ldflags="-pthread"
 		need_link_unlink=yes
 		cat >>confdefs.h <<\_ACEOF
 #define PTHREAD_POINTER_ID 1
 _ACEOF
 
 		libdl=
+		gc_default=boehm
 		libgc_threads=pthreads
+		with_sigaltstack=no
 		use_sigposix=yes
 		;;
 	*-*-linux*)
@@ -3176,7 +3182,6 @@ _ACEOF
 			CPPFLAGS="$CPPFLAGS -DUSE_MUNMAP"
 		fi
 		libmono_cflags="-D_REENTRANT"
-		libmono_ldflags="-lpthread"
 		libdl="-ldl"
 		libgc_threads=pthreads
 		AOT_SUPPORTED="yes"
@@ -4499,6 +4504,98 @@ else
 fi
 
 
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}g++", so it can be a program name with args.
+set dummy ${ac_tool_prefix}g++; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CXX+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CXX"; then
+  ac_cv_prog_CXX="$CXX" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CXX="${ac_tool_prefix}g++"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+CXX=$ac_cv_prog_CXX
+if test -n "$CXX"; then
+  { $as_echo "$as_me:$LINENO: result: $CXX" >&5
+$as_echo "$CXX" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_CXX"; then
+  ac_ct_CXX=$CXX
+  # Extract the first word of "g++", so it can be a program name with args.
+set dummy g++; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_CXX"; then
+  ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_CXX="g++"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CXX=$ac_cv_prog_ac_ct_CXX
+if test -n "$ac_ct_CXX"; then
+  { $as_echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5
+$as_echo "$ac_ct_CXX" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_CXX" = x; then
+    CXX="g++"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    CXX=$ac_ct_CXX
+  fi
+else
+  CXX="$ac_cv_prog_CXX"
+fi
+
 ac_ext=cpp
 ac_cpp='$CXXCPP $CPPFLAGS'
 ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -6029,6 +6126,16 @@ done
 
 
 
+# AC_PROG_CXX helpfully sets CXX to g++ even if no c++ compiler is found so check
+# GXX instead
+if test "$GXX" != "yes"; then
+   # automake/libtool is so broken, it requires g++ even if the c++ sources
+   # are inside automake conditionals
+   { { $as_echo "$as_me:$LINENO: error: You need to install g++" >&5
+$as_echo "$as_me: error: You need to install g++" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
 # Extract the first word of "bison", so it can be a program name with args.
 set dummy bison; ac_word=$2
 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
@@ -7445,13 +7552,13 @@ if test "${lt_cv_nm_interface+set}" = set; then
 else
   lt_cv_nm_interface="BSD nm"
   echo "int some_variable = 0;" > conftest.$ac_ext
-  (eval echo "\"\$as_me:7448: $ac_compile\"" >&5)
+  (eval echo "\"\$as_me:7555: $ac_compile\"" >&5)
   (eval "$ac_compile" 2>conftest.err)
   cat conftest.err >&5
-  (eval echo "\"\$as_me:7451: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
+  (eval echo "\"\$as_me:7558: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
   (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
   cat conftest.err >&5
-  (eval echo "\"\$as_me:7454: output\"" >&5)
+  (eval echo "\"\$as_me:7561: output\"" >&5)
   cat conftest.out >&5
   if $GREP 'External.*some_variable' conftest.out > /dev/null; then
     lt_cv_nm_interface="MS dumpbin"
@@ -8642,7 +8749,7 @@ ia64-*-hpux*)
   ;;
 *-*-irix6*)
   # Find out which ABI we are using.
-  echo '#line 8645 "configure"' > conftest.$ac_ext
+  echo '#line 8752 "configure"' > conftest.$ac_ext
   if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
@@ -10801,11 +10908,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:10804: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:10911: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:10808: \$? = $ac_status" >&5
+   echo "$as_me:10915: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -11140,11 +11247,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:11143: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:11250: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:11147: \$? = $ac_status" >&5
+   echo "$as_me:11254: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -11245,11 +11352,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:11248: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:11355: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:11252: \$? = $ac_status" >&5
+   echo "$as_me:11359: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
@@ -11300,11 +11407,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:11303: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:11410: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:11307: \$? = $ac_status" >&5
+   echo "$as_me:11414: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
@@ -14100,7 +14207,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 14103 "configure"
+#line 14210 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -14196,7 +14303,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 14199 "configure"
+#line 14306 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -16216,11 +16323,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:16219: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:16326: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:16223: \$? = $ac_status" >&5
+   echo "$as_me:16330: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -16315,11 +16422,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:16318: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:16425: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:16322: \$? = $ac_status" >&5
+   echo "$as_me:16429: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
@@ -16367,11 +16474,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:16370: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:16477: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:16374: \$? = $ac_status" >&5
+   echo "$as_me:16481: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
@@ -17853,7 +17960,9 @@ done
 
 
 
-for ac_header in sys/user.h sys/socket.h sys/ipc.h sys/sem.h sys/utsname.h alloca.h ucontext.h pwd.h sys/select.h netinet/tcp.h netinet/in.h unistd.h sys/types.h
+
+
+for ac_header in sys/param.h sys/socket.h sys/ipc.h sys/sem.h sys/utsname.h alloca.h ucontext.h pwd.h sys/select.h netinet/tcp.h netinet/in.h unistd.h sys/types.h link.h asm/sigcontext.h
 do
 as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
@@ -18000,6 +18109,72 @@ done
 
 
 
+for ac_header in sys/user.h
+do
+as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+#ifdef HAVE_SYS_PARAM_H
+# include <sys/param.h>
+#endif
+
+
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  eval "$as_ac_Header=yes"
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	eval "$as_ac_Header=no"
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
 if test "${ac_cv_header_zlib_h+set}" = set; then
   { $as_echo "$as_me:$LINENO: checking for zlib.h" >&5
 $as_echo_n "checking for zlib.h... " >&6; }
@@ -20862,6 +21037,16 @@ _ACEOF
 $as_echo "$as_me: Disabled Soft Debugger." >&6;}
 fi
 
+if test "x$mono_feature_disable_normalization" = "xyes"; then
+
+cat >>confdefs.h <<\_ACEOF
+#define DISABLE_NORMALIZATION 1
+_ACEOF
+
+	{ $as_echo "$as_me:$LINENO: Disabled String normalization support." >&5
+$as_echo "$as_me: Disabled String normalization support." >&6;}
+fi
+
 { $as_echo "$as_me:$LINENO: checking for visibility __attribute__" >&5
 $as_echo_n "checking for visibility __attribute__... " >&6; }
 cat >conftest.$ac_ext <<_ACEOF
@@ -21171,6 +21356,7 @@ _ACEOF
 
 		LIBGC_LIBS="-lgc $libdl"
 		LIBGC_STATIC_LIBS="$LIBGC_LIBS"
+		libmono_ldflags="$libmono_ldflags -lgc"
 
 		# AC_CHECK_FUNCS does not work for some reason...
 		{ $as_echo "$as_me:$LINENO: checking for GC_gcj_malloc in -lgc" >&5
@@ -25040,6 +25226,71 @@ if test "x$ac_cv_lib_pthread_main" = x""yes; then
 fi
 
 		;;
+		*-*-*openbsd*)
+			{ $as_echo "$as_me:$LINENO: checking for main in -lpthread" >&5
+$as_echo_n "checking for main in -lpthread... " >&6; }
+if test "${ac_cv_lib_pthread_main+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lpthread  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+
+int
+main ()
+{
+return main ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  ac_cv_lib_pthread_main=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_pthread_main=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_main" >&5
+$as_echo "$ac_cv_lib_pthread_main" >&6; }
+if test "x$ac_cv_lib_pthread_main" = x""yes; then
+  LIBS="$LIBS -pthread"
+fi
+
+		;;
 		*)
 			{ $as_echo "$as_me:$LINENO: checking for main in -lpthread" >&5
 $as_echo_n "checking for main in -lpthread... " >&6; }
@@ -27622,27 +27873,26 @@ done
 for ac_header in net/if.h
 do
 as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
 $as_echo_n "checking for $ac_header... " >&6; }
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
   $as_echo_n "(cached) " >&6
-fi
-ac_res=`eval 'as_val=${'$as_ac_Header'}
-		 $as_echo "$as_val"'`
-	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
 else
-  # Is the header compilable?
-{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
-$as_echo_n "checking $ac_header usability... " >&6; }
-cat >conftest.$ac_ext <<_ACEOF
+  cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-$ac_includes_default
+
+	   #ifdef HAVE_SYS_TYPES_H
+	   # include <sys/types.h>
+	   #endif
+	   #ifdef HAVE_SYS_SOCKET_H
+	   # include <sys/socket.h>
+	   #endif
+
+
 #include <$ac_header>
 _ACEOF
 rm -f conftest.$ac_objext
@@ -27663,96 +27913,20 @@ $as_echo "$ac_try_echo") >&5
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
-  ac_header_compiler=yes
+  eval "$as_ac_Header=yes"
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-	ac_header_compiler=no
+	eval "$as_ac_Header=no"
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-$as_echo "$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
-$as_echo_n "checking $ac_header presence... " >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <$ac_header>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       }; then
-  ac_header_preproc=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-  ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-$as_echo "$ac_header_preproc" >&6; }
-
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
-$as_echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
-$as_echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-
-    ;;
-esac
-{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
-$as_echo_n "checking for $ac_header... " >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  $as_echo_n "(cached) " >&6
-else
-  eval "$as_ac_Header=\$ac_header_preproc"
 fi
 ac_res=`eval 'as_val=${'$as_ac_Header'}
 		 $as_echo "$as_val"'`
 	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
 $as_echo "$ac_res" >&6; }
-
-fi
 as_val=`eval 'as_val=${'$as_ac_Header'}
 		 $as_echo "$as_val"'`
    if test "x$as_val" = x""yes; then
@@ -28097,6 +28271,152 @@ fi
 done
 
 
+for ac_header in pathconf.h
+do
+as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+fi
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+else
+  # Is the header compilable?
+{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
+$as_echo_n "checking $ac_header usability... " >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_header_compiler=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_header_compiler=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
+$as_echo_n "checking $ac_header presence... " >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$ac_header>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
+  ac_header_preproc=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  ac_header_preproc=no
+fi
+
+rm -f conftest.err conftest.$ac_ext
+{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+
+    ;;
+esac
+{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+else
+  eval "$as_ac_Header=\$ac_header_preproc"
+fi
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+
+fi
+as_val=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
 for ac_header in fstab.h
 do
 as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
@@ -29560,6 +29880,72 @@ done
 for ac_header in sys/mount.h
 do
 as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+		#ifdef HAVE_SYS_PARAM_H
+		# include <sys/param.h>
+		#endif
+
+
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  eval "$as_ac_Header=yes"
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	eval "$as_ac_Header=no"
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+for ac_header in sys/mount.h
+do
+as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
   { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
 $as_echo_n "checking for $ac_header... " >&6; }
@@ -29703,6 +30089,209 @@ fi
 done
 
 
+for ac_func in confstr
+do
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $ac_func innocuous_$ac_func
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $ac_func (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $ac_func
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char $ac_func ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_$ac_func || defined __stub___$ac_func
+choke me
+#endif
+
+int
+main ()
+{
+return $ac_func ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  eval "$as_ac_var=yes"
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	eval "$as_ac_var=no"
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+ac_res=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+
+
+for ac_func in seekdir telldir
+do
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $ac_func innocuous_$ac_func
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $ac_func (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $ac_func
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char $ac_func ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_$ac_func || defined __stub___$ac_func
+choke me
+#endif
+
+int
+main ()
+{
+return $ac_func ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  eval "$as_ac_var=yes"
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	eval "$as_ac_var=no"
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+ac_res=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+
 for ac_func in getdomainname
 do
 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
@@ -29905,7 +30494,10 @@ fi
 done
 
 
-for ac_func in fgetgrent
+
+
+
+for ac_func in endgrent getgrent fgetgrent setgrent
 do
 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -30006,7 +30598,7 @@ fi
 done
 
 
-for ac_func in fgetpwent
+for ac_func in setgroups
 do
 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -30107,7 +30699,10 @@ fi
 done
 
 
-for ac_func in fgetpwent
+
+
+
+for ac_func in endpwent getpwent fgetpwent setpwent
 do
 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -30309,7 +30904,8 @@ fi
 done
 
 
-for ac_func in lutimes
+
+for ac_func in lutimes futimes
 do
 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -31117,7 +31713,109 @@ fi
 done
 
 
-for ac_func in sethostid
+
+for ac_func in gethostid sethostid
+do
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $ac_func innocuous_$ac_func
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $ac_func (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $ac_func
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char $ac_func ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_$ac_func || defined __stub___$ac_func
+choke me
+#endif
+
+int
+main ()
+{
+return $ac_func ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  eval "$as_ac_var=yes"
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	eval "$as_ac_var=no"
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+ac_res=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+
+for ac_func in sethostname
 do
 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -31924,6 +32622,512 @@ _ACEOF
 fi
 done
 
+
+for ac_func in psignal
+do
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $ac_func innocuous_$ac_func
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $ac_func (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $ac_func
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char $ac_func ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_$ac_func || defined __stub___$ac_func
+choke me
+#endif
+
+int
+main ()
+{
+return $ac_func ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  eval "$as_ac_var=yes"
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	eval "$as_ac_var=no"
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+ac_res=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+
+for ac_func in getlogin_r
+do
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $ac_func innocuous_$ac_func
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $ac_func (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $ac_func
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char $ac_func ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_$ac_func || defined __stub___$ac_func
+choke me
+#endif
+
+int
+main ()
+{
+return $ac_func ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  eval "$as_ac_var=yes"
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	eval "$as_ac_var=no"
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+ac_res=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+
+for ac_func in lockf
+do
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $ac_func innocuous_$ac_func
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $ac_func (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $ac_func
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char $ac_func ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_$ac_func || defined __stub___$ac_func
+choke me
+#endif
+
+int
+main ()
+{
+return $ac_func ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  eval "$as_ac_var=yes"
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	eval "$as_ac_var=no"
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+ac_res=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+
+for ac_func in swab
+do
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $ac_func innocuous_$ac_func
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $ac_func (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $ac_func
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char $ac_func ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_$ac_func || defined __stub___$ac_func
+choke me
+#endif
+
+int
+main ()
+{
+return $ac_func ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  eval "$as_ac_var=yes"
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	eval "$as_ac_var=no"
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+ac_res=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+
+
+for ac_func in setusershell endusershell
+do
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $ac_func innocuous_$ac_func
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $ac_func (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $ac_func
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char $ac_func ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_$ac_func || defined __stub___$ac_func
+choke me
+#endif
+
+int
+main ()
+{
+return $ac_func ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  eval "$as_ac_var=yes"
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	eval "$as_ac_var=no"
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+ac_res=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
 	# The cast to long int works around a bug in the HP C Compiler
 # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
 # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
@@ -33705,6 +34909,222 @@ _ACEOF
 
 fi
 
+	{ $as_echo "$as_me:$LINENO: checking for struct passwd.pw_gecos" >&5
+$as_echo_n "checking for struct passwd.pw_gecos... " >&6; }
+if test "${ac_cv_member_struct_passwd_pw_gecos+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <sys/types.h>
+		 #include <pwd.h>
+
+int
+main ()
+{
+static struct passwd ac_aggr;
+if (ac_aggr.pw_gecos)
+return 0;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_member_struct_passwd_pw_gecos=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <sys/types.h>
+		 #include <pwd.h>
+
+int
+main ()
+{
+static struct passwd ac_aggr;
+if (sizeof ac_aggr.pw_gecos)
+return 0;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_member_struct_passwd_pw_gecos=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_member_struct_passwd_pw_gecos=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_passwd_pw_gecos" >&5
+$as_echo "$ac_cv_member_struct_passwd_pw_gecos" >&6; }
+if test "x$ac_cv_member_struct_passwd_pw_gecos" = x""yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_PASSWD_PW_GECOS 1
+_ACEOF
+
+
+fi
+
+	{ $as_echo "$as_me:$LINENO: checking for struct statfs.f_flags" >&5
+$as_echo_n "checking for struct statfs.f_flags... " >&6; }
+if test "${ac_cv_member_struct_statfs_f_flags+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <sys/types.h>
+		 #include <sys/vfs.h>
+
+int
+main ()
+{
+static struct statfs ac_aggr;
+if (ac_aggr.f_flags)
+return 0;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_member_struct_statfs_f_flags=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <sys/types.h>
+		 #include <sys/vfs.h>
+
+int
+main ()
+{
+static struct statfs ac_aggr;
+if (sizeof ac_aggr.f_flags)
+return 0;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_member_struct_statfs_f_flags=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_member_struct_statfs_f_flags=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_statfs_f_flags" >&5
+$as_echo "$ac_cv_member_struct_statfs_f_flags" >&6; }
+if test "x$ac_cv_member_struct_statfs_f_flags" = x""yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_STATFS_F_FLAGS 1
+_ACEOF
+
+
+fi
+
 
 		{ $as_echo "$as_me:$LINENO: checking for lsetxattr" >&5
 $as_echo_n "checking for lsetxattr... " >&6; }
@@ -33880,6 +35300,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 #include <sys/types.h>
+		 #include <sys/param.h>
 		 #include <sys/sysctl.h>
 		 #include <sys/proc.h>
 
@@ -33924,6 +35345,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 #include <sys/types.h>
+		 #include <sys/param.h>
 		 #include <sys/sysctl.h>
 		 #include <sys/proc.h>
 
@@ -35538,8 +36960,8 @@ fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
-{ $as_echo "$as_me:$LINENO: checking for array element initalizer support" >&5
-$as_echo_n "checking for array element initalizer support... " >&6; }
+{ $as_echo "$as_me:$LINENO: checking for array element initializer support" >&5
+$as_echo_n "checking for array element initializer support... " >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -36055,7 +37477,7 @@ $as_echo "$try_dev_random" >&6; }
 
 case "{$target}" in
     *-openbsd*)
-    NAME_DEV_RANDOM="/dev/srandom"
+    NAME_DEV_RANDOM="/dev/arandom"
     ;;
 
 
@@ -37793,8 +39215,147 @@ if test "${with_mcs_docs+set}" = set; then
 		DISABLE_MCS_DOCS=yes
 	fi
 
+else
+  with_moonlight=no
+fi
+
+
+if test "${ac_cv_header_malloc_h+set}" = set; then
+  { $as_echo "$as_me:$LINENO: checking for malloc.h" >&5
+$as_echo_n "checking for malloc.h... " >&6; }
+if test "${ac_cv_header_malloc_h+set}" = set; then
+  $as_echo_n "(cached) " >&6
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_malloc_h" >&5
+$as_echo "$ac_cv_header_malloc_h" >&6; }
+else
+  # Is the header compilable?
+{ $as_echo "$as_me:$LINENO: checking malloc.h usability" >&5
+$as_echo_n "checking malloc.h usability... " >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+#include <malloc.h>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_header_compiler=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_header_compiler=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ $as_echo "$as_me:$LINENO: checking malloc.h presence" >&5
+$as_echo_n "checking malloc.h presence... " >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <malloc.h>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
+  ac_header_preproc=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  ac_header_preproc=no
 fi
 
+rm -f conftest.err conftest.$ac_ext
+{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { $as_echo "$as_me:$LINENO: WARNING: malloc.h: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: malloc.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: malloc.h: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: malloc.h: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { $as_echo "$as_me:$LINENO: WARNING: malloc.h: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: malloc.h: present but cannot be compiled" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: malloc.h:     check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: malloc.h:     check for missing prerequisite headers?" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: malloc.h: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: malloc.h: see the Autoconf documentation" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: malloc.h:     section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: malloc.h:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: malloc.h: proceeding with the preprocessor's result" >&5
+$as_echo "$as_me: WARNING: malloc.h: proceeding with the preprocessor's result" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: malloc.h: in the future, the compiler will take precedence" >&5
+$as_echo "$as_me: WARNING: malloc.h: in the future, the compiler will take precedence" >&2;}
+
+    ;;
+esac
+{ $as_echo "$as_me:$LINENO: checking for malloc.h" >&5
+$as_echo_n "checking for malloc.h... " >&6; }
+if test "${ac_cv_header_malloc_h+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_cv_header_malloc_h=$ac_header_preproc
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_malloc_h" >&5
+$as_echo "$ac_cv_header_malloc_h" >&6; }
+
+fi
+if test "x$ac_cv_header_malloc_h" = x""yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_USR_INCLUDE_MALLOC_H 1
+_ACEOF
+
+fi
+
+
 
 if test x$cross_compiling = xyes -o x$enable_mcs_build = xno; then
    DISABLE_MCS_DOCS=yes
@@ -41593,6 +43154,15 @@ fi
   fi
 )
 
+ if test x$DISABLE_MCS_DOCS = xyes; then
+  DISABLE_MCS_DOCS_TRUE=
+  DISABLE_MCS_DOCS_FALSE='#'
+else
+  DISABLE_MCS_DOCS_TRUE='#'
+  DISABLE_MCS_DOCS_FALSE=
+fi
+
+
 libgdiplus_msg=${libgdiplus_loc:-assumed to be installed}
 
 echo "
diff --git a/configure.in b/configure.in
index 6499268..30c2694 100644
--- a/configure.in
+++ b/configure.in
@@ -6,7 +6,7 @@ AC_CANONICAL_SYSTEM
 m4_ifdef([_A][M_PROG_TAR],[_A][M_SET_OPTION([tar-ustar])])
 
 AM_CONFIG_HEADER(config.h)
-AM_INIT_AUTOMAKE(mono,2.6.3)
+AM_INIT_AUTOMAKE(mono,2.6.7)
 AM_MAINTAINER_MODE
 
 API_VER=1.0
@@ -147,14 +147,18 @@ case "$host" in
 		;;
 	*-*-*openbsd*)
 		platform_win32=no
-		CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE -DGC_FREEBSD_THREADS -DPLATFORM_BSD"
-		libmono_cflags="-D_THREAD_SAFE"
+		CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE -DGC_OPENBSD_THREADS -DPLATFORM_BSD -D_GNU_SOURCE -D_REENTRANT -DUSE_MMAP"
+		if test "x$disable_munmap" != "xyes"; then
+		CPPFLAGS="$CPPFLAGS -DUSE_MUNMAP"
+		fi
+		libmono_cflags="-D_THREAD_SAFE -D_REENTRANT"
 		LDFLAGS="$LDFLAGS -pthread"
-		libmono_ldflags="-pthread"
 		need_link_unlink=yes
 		AC_DEFINE(PTHREAD_POINTER_ID)
 		libdl=
+		gc_default=boehm
 		libgc_threads=pthreads
+		with_sigaltstack=no
 		use_sigposix=yes
 		;;
 	*-*-linux*)
@@ -164,7 +168,6 @@ case "$host" in
 			CPPFLAGS="$CPPFLAGS -DUSE_MUNMAP"
 		fi
 		libmono_cflags="-D_REENTRANT"
-		libmono_ldflags="-lpthread"
 		libdl="-ldl"
 		libgc_threads=pthreads
 		AOT_SUPPORTED="yes"
@@ -256,6 +259,7 @@ AM_CONDITIONAL(PLATFORM_SIGPOSIX, test x$use_sigposix = xyes)
 
 AC_CHECK_TOOL(CC, gcc, gcc)
 AC_PROG_CC
+AC_CHECK_TOOL(CXX, g++, g++)
 AC_PROG_CXX
 AM_PROG_AS
 AM_PROG_CC_STDC
@@ -268,6 +272,14 @@ dnl We should use AM_PROG_AS, but it's not available on automake/aclocal 1.4
 AC_SUBST(CCAS)
 AC_SUBST(CCASFLAGS)
 
+# AC_PROG_CXX helpfully sets CXX to g++ even if no c++ compiler is found so check
+# GXX instead
+if test "$GXX" != "yes"; then
+   # automake/libtool is so broken, it requires g++ even if the c++ sources
+   # are inside automake conditionals
+   AC_MSG_ERROR([You need to install g++])
+fi
+
 AC_CHECK_PROG(BISON, bison,yes,no)
 if test "x$BISON" = "xno";
 then
@@ -315,8 +327,14 @@ fi
 AM_CONDITIONAL(NO_VERSION_SCRIPT, test x$no_version_script = xyes)
 
 AC_CHECK_HEADERS(sys/filio.h sys/sockio.h netdb.h utime.h sys/utime.h semaphore.h sys/un.h linux/rtc.h sys/syscall.h sys/mkdev.h sys/uio.h)
-AC_CHECK_HEADERS(sys/user.h sys/socket.h sys/ipc.h sys/sem.h sys/utsname.h alloca.h ucontext.h pwd.h sys/select.h netinet/tcp.h netinet/in.h unistd.h sys/types.h)
+AC_CHECK_HEADERS(sys/param.h sys/socket.h sys/ipc.h sys/sem.h sys/utsname.h alloca.h ucontext.h pwd.h sys/select.h netinet/tcp.h netinet/in.h unistd.h sys/types.h link.h asm/sigcontext.h)
 
+AC_CHECK_HEADERS(sys/user.h, [], [],
+[
+#ifdef HAVE_SYS_PARAM_H
+# include <sys/param.h>
+#endif
+])
 
 AC_CHECK_HEADER(zlib.h, [have_zlib=yes], [have_zlib=no])
 if test x$have_zlib = xyes; then
@@ -612,7 +630,7 @@ DISABLED_FEATURES=none
 
 AC_ARG_ENABLE(minimal, [  --enable-minimal=LIST      drop support for LIST subsystems.
      LIST is a comma-separated list from: aot, profiler, decimal, pinvoke, debug,
-     reflection_emit, reflection_emit_save, large_code, logging, com, ssa, generics, attach, jit, simd,soft_debug.],
+     reflection_emit, reflection_emit_save, large_code, logging, com, ssa, generics, attach, jit, simd, soft_debug, normalization.],
 [
 	for feature in `echo "$enable_minimal" | sed -e "s/,/ /g"`; do
 		eval "mono_feature_disable_$feature='yes'"
@@ -727,6 +745,11 @@ if test "x$mono_feature_disable_soft_debug" = "xyes"; then
 	AC_MSG_NOTICE([Disabled Soft Debugger.])
 fi
 
+if test "x$mono_feature_disable_normalization" = "xyes"; then
+	AC_DEFINE(DISABLE_NORMALIZATION, 1, [Disable String normalization support.])
+	AC_MSG_NOTICE([Disabled String normalization support.])
+fi
+
 AC_MSG_CHECKING(for visibility __attribute__)
 AC_TRY_COMPILE([], [
    void __attribute__ ((visibility ("hidden"))) doit (void) {}
@@ -764,6 +787,7 @@ case "x$gc" in
 		AC_SUBST(HAVE_BOEHM_GC)
 		LIBGC_LIBS="-lgc $libdl"
 		LIBGC_STATIC_LIBS="$LIBGC_LIBS"
+		libmono_ldflags="$libmono_ldflags -lgc"
 
 		# AC_CHECK_FUNCS does not work for some reason...
 		AC_CHECK_LIB(gc, GC_gcj_malloc, found_gcj_malloc="yes",,$libdl)
@@ -1228,6 +1252,9 @@ if test x$platform_win32 = xno; then
 		*-*-*freebsd*)
 			AC_CHECK_LIB(pthread, main, LIBS="$LIBS -pthread")
 		;;
+		*-*-*openbsd*)
+			AC_CHECK_LIB(pthread, main, LIBS="$LIBS -pthread")
+		;;
 		*)
 			AC_CHECK_LIB(pthread, main, LIBS="$LIBS -lpthread")
 		;;
@@ -1488,7 +1515,15 @@ if test x$platform_win32 = xno; then
 	dnl *** Checks for SIOCGIFCONF ***
 	dnl ******************************
 	AC_CHECK_HEADERS(sys/ioctl.h)
-	AC_CHECK_HEADERS(net/if.h)
+	AC_CHECK_HEADERS(net/if.h, [], [],
+	   [
+	   #ifdef HAVE_SYS_TYPES_H
+	   # include <sys/types.h>
+	   #endif
+	   #ifdef HAVE_SYS_SOCKET_H
+	   # include <sys/socket.h>
+	   #endif
+	   ])
 	AC_MSG_CHECKING(for ifreq)
 	AC_TRY_COMPILE([
 		#include <stdio.h>
@@ -1541,6 +1576,7 @@ if test x$platform_win32 = xno; then
 	dnl *** Checks for MonoPosixHelper ***
 	dnl **********************************
 	AC_CHECK_HEADERS(checklist.h)
+	AC_CHECK_HEADERS(pathconf.h)
 	AC_CHECK_HEADERS(fstab.h)
 	AC_CHECK_HEADERS(attr/xattr.h)
 	AC_CHECK_HEADERS(sys/extattr.h)
@@ -1551,14 +1587,22 @@ if test x$platform_win32 = xno; then
 	AC_CHECK_HEADERS(sys/xattr.h)
 	AC_CHECK_HEADERS(sys/mman.h)
 	AC_CHECK_HEADERS(sys/param.h)
+	AC_CHECK_HEADERS(sys/mount.h, [], [],
+		[
+		#ifdef HAVE_SYS_PARAM_H
+		# include <sys/param.h>
+		#endif
+		])
 	AC_CHECK_HEADERS(sys/mount.h)
+	AC_CHECK_FUNCS(confstr)
+	AC_CHECK_FUNCS(seekdir telldir)
 	AC_CHECK_FUNCS(getdomainname)
 	AC_CHECK_FUNCS(setdomainname)
-	AC_CHECK_FUNCS(fgetgrent)
-	AC_CHECK_FUNCS(fgetpwent)
-	AC_CHECK_FUNCS(fgetpwent)
+	AC_CHECK_FUNCS(endgrent getgrent fgetgrent setgrent)
+	AC_CHECK_FUNCS(setgroups)
+	AC_CHECK_FUNCS(endpwent getpwent fgetpwent setpwent)
 	AC_CHECK_FUNCS(getfsstat)
-	AC_CHECK_FUNCS(lutimes)
+	AC_CHECK_FUNCS(lutimes futimes)
 	AC_CHECK_FUNCS(mremap)
 	AC_CHECK_FUNCS(remap_file_pages)
 	AC_CHECK_FUNCS(posix_fadvise)
@@ -1566,7 +1610,8 @@ if test x$platform_win32 = xno; then
 	AC_CHECK_FUNCS(posix_madvise)
 	AC_CHECK_FUNCS(vsnprintf)
 	AC_CHECK_FUNCS(sendfile)
-	AC_CHECK_FUNCS(sethostid)
+	AC_CHECK_FUNCS(gethostid sethostid)
+	AC_CHECK_FUNCS(sethostname)
 	AC_CHECK_FUNCS(statfs)
 	AC_CHECK_FUNCS(fstatfs)
 	AC_CHECK_FUNCS(statvfs)
@@ -1574,6 +1619,11 @@ if test x$platform_win32 = xno; then
 	AC_CHECK_FUNCS(stime)
 	AC_CHECK_FUNCS(strerror_r)
 	AC_CHECK_FUNCS(ttyname_r)
+	AC_CHECK_FUNCS(psignal)
+	AC_CHECK_FUNCS(getlogin_r)
+	AC_CHECK_FUNCS(lockf)
+	AC_CHECK_FUNCS(swab)
+	AC_CHECK_FUNCS(setusershell endusershell)
 	AC_CHECK_SIZEOF(size_t)
 	AC_CHECK_TYPES([blksize_t], [AC_DEFINE(HAVE_BLKSIZE_T)], , 
 		[#include <sys/types.h>
@@ -1609,6 +1659,14 @@ if test x$platform_win32 = xno; then
 		[struct dirent.d_off, struct dirent.d_reclen, struct dirent.d_type],,, 
 		[#include <sys/types.h>
 		 #include <dirent.h>])
+	AC_CHECK_MEMBERS(
+		[struct passwd.pw_gecos],,, 
+		[#include <sys/types.h>
+		 #include <pwd.h>])
+	AC_CHECK_MEMBERS(
+		[struct statfs.f_flags],,, 
+		[#include <sys/types.h>
+		 #include <sys/vfs.h>])
 
 	dnl Favour xattr through glibc, but use libattr if we have to
 	AC_CHECK_FUNC(lsetxattr, ,
@@ -1620,6 +1678,7 @@ if test x$platform_win32 = xno; then
 	AC_CHECK_MEMBERS(
 		[struct kinfo_proc.kp_proc],,, 
 		[#include <sys/types.h>
+		 #include <sys/param.h>
 		 #include <sys/sysctl.h>
 		 #include <sys/proc.h>
 		 ])
@@ -1700,7 +1759,7 @@ ac_cv_c_socklen_t=yes
 	AC_MSG_RESULT(no)
 ])
 
-AC_MSG_CHECKING(for array element initalizer support)
+AC_MSG_CHECKING(for array element initializer support)
 AC_TRY_COMPILE([#include <sys/socket.h>], [
 	const int array[] = {[1] = 2,};
 ], [
@@ -1743,7 +1802,7 @@ AC_MSG_RESULT($try_dev_random)
 
 case "{$target}" in
     *-openbsd*)
-    NAME_DEV_RANDOM="/dev/srandom"
+    NAME_DEV_RANDOM="/dev/arandom"
     ;;
 
 dnl Win32 does not have /dev/random, they have their own method...
@@ -2373,7 +2432,11 @@ AC_ARG_WITH(mcs_docs,[  --with-mcs-docs=yes,no         If you want to build the
 	if test x$with_mcs_docs != xyes; then
 		DISABLE_MCS_DOCS=yes
 	fi
-])
+], [with_moonlight=no])
+
+AC_CHECK_HEADER([malloc.h], 
+		[AC_DEFINE([HAVE_USR_INCLUDE_MALLOC_H], [1], 
+			[Define to 1 if you have /usr/include/malloc.h.])],,)
 
 dnl
 dnl Consistency settings
@@ -2715,6 +2778,8 @@ fi
   fi
 )
 
+AM_CONDITIONAL(DISABLE_MCS_DOCS, test x$DISABLE_MCS_DOCS = xyes)
+
 libgdiplus_msg=${libgdiplus_loc:-assumed to be installed}
 
 echo "
diff --git a/data/mono.pc.in b/data/mono.pc.in
index 6da0960..01e0a9e 100644
--- a/data/mono.pc.in
+++ b/data/mono.pc.in
@@ -7,6 +7,8 @@ sysconfdir=@sysconfdir@
 Name: Mono
 Description: Mono Runtime
 Version: @VERSION@
-Requires: glib-2.0 gthread-2.0
+## Commented out because SLE hides devel files in the SLE SDK,
+## which not all customers will have.
+#Requires: glib-2.0 gthread-2.0
 Libs: -L${libdir} @export_ldflags@ -lmono @libmono_ldflags@
 Cflags: -I${includedir} @libmono_cflags@
diff --git a/docs/ChangeLog b/docs/ChangeLog
index 4ad7435..e896930 100644
--- a/docs/ChangeLog
+++ b/docs/ChangeLog
@@ -1,4 +1,9 @@
+2010-04-21  Andrés G. Aragoneses  <andres at lindenlab.com>
+
+	* Makefile.am: Make ASSEMBLED_DOCS empty in case of DISABLED_MCS_DOCS.
+
 2009-12-22  Jo Shields  <directhex at apebox.org>
+
 	* HtmlAgilityPack/LICENSE: Include upstream license (Ms-PL) since the
 	  file headers don't specify it
 
diff --git a/docs/Makefile.am b/docs/Makefile.am
index 639b753..96d5eb2 100644
--- a/docs/Makefile.am
+++ b/docs/Makefile.am
@@ -6,10 +6,14 @@ sources_DATA = \
 	monoapi.source \
 	$(ASSEMBLED_DOCS)
 
+if DISABLE_MCS_DOCS
+ASSEMBLED_DOCS = 
+else
 ASSEMBLED_DOCS = \
 	mono-file-formats.tree mono-file-formats.zip  \
 	mono-tools.tree mono-tools.zip                \
 	monoapi.tree monoapi.zip
+endif
 
 EXTRA_DIST = \
 	abc-removal.txt		\
diff --git a/docs/Makefile.in b/docs/Makefile.in
index 431c8ac..fa038c6 100644
--- a/docs/Makefile.in
+++ b/docs/Makefile.in
@@ -258,11 +258,12 @@ sources_DATA = \
 	monoapi.source \
 	$(ASSEMBLED_DOCS)
 
-ASSEMBLED_DOCS = \
-	mono-file-formats.tree mono-file-formats.zip  \
-	mono-tools.tree mono-tools.zip                \
-	monoapi.tree monoapi.zip
+ at DISABLE_MCS_DOCS_FALSE@ASSEMBLED_DOCS = \
+ at DISABLE_MCS_DOCS_FALSE@	mono-file-formats.tree mono-file-formats.zip  \
+ at DISABLE_MCS_DOCS_FALSE@	mono-tools.tree mono-tools.zip                \
+ at DISABLE_MCS_DOCS_FALSE@	monoapi.tree monoapi.zip
 
+ at DISABLE_MCS_DOCS_TRUE@ASSEMBLED_DOCS = 
 EXTRA_DIST = \
 	abc-removal.txt		\
 	api-style.css		\
diff --git a/libgc/ChangeLog b/libgc/ChangeLog
index 5c3c7d3..37ef9d8 100644
--- a/libgc/ChangeLog
+++ b/libgc/ChangeLog
@@ -1,3 +1,21 @@
+2010-06-14  Geoff Norton  <gnorton at novell.com>
+
+	* dyn_load.c: Fix one other place where l_addr could be null on 
+	bionic.
+
+2010-05-31  Geoff Norton  <gnorton at novell.com>
+
+	* dyn_load.c: Its possible for linkmap->l_addr to be null for the
+	linker entry on some systems (Android/Bionic based libc's)
+
+2010-04-19  Jonathan Pryor  <jpryor at novell.com>
+
+	* include/private/gcconfig.h: Android platforms are built atop Linux,
+	  don't use glibc, and uses `environ` instead of `__environ`.
+	* configure.in: Use AC_CHECK_LIB() to check for pthread instead of
+	  just blindly linking to -lpthread, as Android includes pthread
+	  support within libc and doesn't provide a separate libpthread.
+
 2010-03-09  Zoltan Varga  <vargaz at gmail.com>
 
 	* include/private/gc_locks.h: Fix amd64 build with newer gcc's.
diff --git a/libgc/configure b/libgc/configure
index 49c1def..ff9d146 100755
--- a/libgc/configure
+++ b/libgc/configure
@@ -4713,7 +4713,76 @@ case "$THREADS" in
     ;;
  posix | pthreads)
     THREADS=posix
-    THREADDLLIBS=-lpthread
+
+{ $as_echo "$as_me:$LINENO: checking for pthread_self in -lpthread" >&5
+$as_echo_n "checking for pthread_self in -lpthread... " >&6; }
+if test "${ac_cv_lib_pthread_pthread_self+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lpthread  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char pthread_self ();
+int
+main ()
+{
+return pthread_self ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  ac_cv_lib_pthread_pthread_self=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_pthread_pthread_self=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_pthread_self" >&5
+$as_echo "$ac_cv_lib_pthread_pthread_self" >&6; }
+if test "x$ac_cv_lib_pthread_pthread_self" = x""yes; then
+  THREADDLLIBS="-lpthread"
+fi
+
     case "$host" in
      x86-*-linux* | ia64-*-linux* | i386-*-linux* | i486-*-linux* | i586-*-linux* | i686-*-linux* | x86_64-*-linux* | alpha*-*-linux* | s390*-*-linux* | sparc*-*-linux* | powerpc-*-linux*)
 	cat >>confdefs.h <<\_ACEOF
@@ -4957,7 +5026,6 @@ fi
 
 { $as_echo "$as_me:$LINENO: checking for xlc" >&5
 $as_echo_n "checking for xlc... " >&6; }
-
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -5892,13 +5960,13 @@ if test "${lt_cv_nm_interface+set}" = set; then
 else
   lt_cv_nm_interface="BSD nm"
   echo "int some_variable = 0;" > conftest.$ac_ext
-  (eval echo "\"\$as_me:5895: $ac_compile\"" >&5)
+  (eval echo "\"\$as_me:5963: $ac_compile\"" >&5)
   (eval "$ac_compile" 2>conftest.err)
   cat conftest.err >&5
-  (eval echo "\"\$as_me:5898: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
+  (eval echo "\"\$as_me:5966: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
   (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
   cat conftest.err >&5
-  (eval echo "\"\$as_me:5901: output\"" >&5)
+  (eval echo "\"\$as_me:5969: output\"" >&5)
   cat conftest.out >&5
   if $GREP 'External.*some_variable' conftest.out > /dev/null; then
     lt_cv_nm_interface="MS dumpbin"
@@ -7103,7 +7171,7 @@ ia64-*-hpux*)
   ;;
 *-*-irix6*)
   # Find out which ABI we are using.
-  echo '#line 7106 "configure"' > conftest.$ac_ext
+  echo '#line 7174 "configure"' > conftest.$ac_ext
   if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
@@ -9645,11 +9713,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:9648: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:9716: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:9652: \$? = $ac_status" >&5
+   echo "$as_me:9720: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -9984,11 +10052,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:9987: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:10055: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:9991: \$? = $ac_status" >&5
+   echo "$as_me:10059: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -10089,11 +10157,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:10092: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:10160: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:10096: \$? = $ac_status" >&5
+   echo "$as_me:10164: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
@@ -10144,11 +10212,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:10147: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:10215: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:10151: \$? = $ac_status" >&5
+   echo "$as_me:10219: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
@@ -12944,7 +13012,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 12947 "configure"
+#line 13015 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -13040,7 +13108,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 13043 "configure"
+#line 13111 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -15060,11 +15128,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:15063: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:15131: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:15067: \$? = $ac_status" >&5
+   echo "$as_me:15135: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -15159,11 +15227,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:15162: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:15230: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:15166: \$? = $ac_status" >&5
+   echo "$as_me:15234: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
@@ -15211,11 +15279,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:15214: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:15282: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:15218: \$? = $ac_status" >&5
+   echo "$as_me:15286: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
diff --git a/libgc/configure.in b/libgc/configure.in
index 2749d08..2f7e173 100644
--- a/libgc/configure.in
+++ b/libgc/configure.in
@@ -84,7 +84,7 @@ case "$THREADS" in
     ;;
  posix | pthreads)
     THREADS=posix
-    THREADDLLIBS=-lpthread
+    AC_CHECK_LIB(pthread, pthread_self, THREADDLLIBS="-lpthread",,)
     case "$host" in
      x86-*-linux* | ia64-*-linux* | i386-*-linux* | i486-*-linux* | i586-*-linux* | i686-*-linux* | x86_64-*-linux* | alpha*-*-linux* | s390*-*-linux* | sparc*-*-linux* | powerpc-*-linux*)
 	AC_DEFINE(GC_LINUX_THREADS)
diff --git a/libgc/dyn_load.c b/libgc/dyn_load.c
index a6e3316..a42efd4 100644
--- a/libgc/dyn_load.c
+++ b/libgc/dyn_load.c
@@ -250,7 +250,10 @@ void GC_register_dynamic_libraries()
         char * start;
         register int i;
         
-	e = (ElfW(Ehdr) *) lm->l_addr;
+        e = (ElfW(Ehdr) *) lm->l_addr;
+        if (e == NULL)
+          continue;
+
         p = ((ElfW(Phdr) *)(((char *)(e)) + e->e_phoff));
         offset = ((unsigned long)(lm->l_addr));
         for( i = 0; i < (int)(e->e_phnum); ((i++),(p++)) ) {
@@ -544,7 +547,10 @@ void GC_register_dynamic_libraries()
         char * start;
         register int i;
         
-	e = (ElfW(Ehdr) *) lm->l_addr;
+        e = (ElfW(Ehdr) *) lm->l_addr;
+        if (e == NULL)
+          continue;
+
         p = ((ElfW(Phdr) *)(((char *)(e)) + e->e_phoff));
         offset = ((unsigned long)(lm->l_addr));
         for( i = 0; i < (int)(e->e_phnum); ((i++),(p++)) ) {
diff --git a/libgc/include/private/gcconfig.h b/libgc/include/private/gcconfig.h
index d46e686..30ac306 100644
--- a/libgc/include/private/gcconfig.h
+++ b/libgc/include/private/gcconfig.h
@@ -713,6 +713,9 @@
 #	     if defined(__GLIBC__)&& __GLIBC__>=2
 #              define SEARCH_FOR_DATA_START
 #	     else /* !GLIBC2 */
+#              if defined(PLATFORM_ANDROID)
+#                      define __environ environ
+#              endif
                extern char **__environ;
 #              define DATASTART ((ptr_t)(&__environ))
                              /* hideous kludge: __environ is the first */
diff --git a/mcs/Makefile b/mcs/Makefile
index bfb13c3..09d7940 100644
--- a/mcs/Makefile
+++ b/mcs/Makefile
@@ -11,7 +11,7 @@ net_2_1_raw_SUBDIRS := build mcs class tools
 net_2_1_SUBDIRS := tools tests errors
 monotouch_SUBDIRS := build mcs class
 monotouch_bootstrap_SUBDIRS := build mcs class
-net_3_5_SUBDIRS := build class
+net_3_5_SUBDIRS := build class tools/xbuild
 net_4_0_bootstrap_SUBDIRS := build mcs class tools
 net_4_0_SUBDIRS := build mcs class nunit24 ilasm tools tests errors
 
diff --git a/mcs/build/ChangeLog b/mcs/build/ChangeLog
index 5d3f1e4..4318f11 100644
--- a/mcs/build/ChangeLog
+++ b/mcs/build/ChangeLog
@@ -1,3 +1,8 @@
+2010-04-01  Zoltan Varga  <vargaz at gmail.com>
+
+	* config-default.make (LIBRARY_FLAGS): Applied patch from Laurent Etiemble
+	(laurent.etiemble at gmail.com). Use CFLAGS in the environment if defined.
+
 2010-01-12  Zoltan Varga  <vargaz at gmail.com>
 
 	* profiles/basic.make: Document that mono 2.6 can't be compiled with mono SVN HEAD.
diff --git a/mcs/build/common/Consts.cs b/mcs/build/common/Consts.cs
index f56c49c..0a4bbc1 100644
--- a/mcs/build/common/Consts.cs
+++ b/mcs/build/common/Consts.cs
@@ -46,7 +46,7 @@ internal
 	// Use these assembly version constants to make code more maintainable.
 	//
 
-	public const string MonoVersion = "2.6.3.0";
+	public const string MonoVersion = "2.6.7.0";
 	public const string MonoCompany = "MONO development team";
 	public const string MonoProduct = "MONO Common language infrastructure";
 	public const string MonoCopyright = "(c) various MONO Authors";
diff --git a/mcs/build/config-default.make b/mcs/build/config-default.make
index c556006..a696959 100644
--- a/mcs/build/config-default.make
+++ b/mcs/build/config-default.make
@@ -14,7 +14,9 @@ TEST_HARNESS = $(topdir)/class/lib/$(PROFILE)/nunit-console.exe
 MCS_FLAGS = $(PLATFORM_DEBUG_FLAGS)
 MBAS_FLAGS = $(PLATFORM_DEBUG_FLAGS)
 LIBRARY_FLAGS = /noconfig
+ifndef CFLAGS
 CFLAGS = -g -O2
+endif
 prefix = /usr/local
 exec_prefix = $(prefix)
 mono_libdir = $(exec_prefix)/lib
diff --git a/mcs/class/Makefile b/mcs/class/Makefile
index 2e2957c..468b364 100644
--- a/mcs/class/Makefile
+++ b/mcs/class/Makefile
@@ -116,6 +116,7 @@ net_2_0_dirs := \
 	System.Web.DynamicData		\
 	System.ServiceModel.Web		\
 	System.Web.Mvc			\
+	System.Web.Mvc2			\
 	Mono.C5				\
 	Mono.Management			\
 	Mono.Options 			\
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
index cea513c..070e940 100644
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
@@ -1,3 +1,24 @@
+2010-07-08 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* ThemeWin32Classic.cs: implement ResetDefaults.
+	Fixes bug #581956.
+
+2010-07-05  Dick Porter  <dporter at codicesoftware.com>
+
+	* MenuAPI.cs: Only handle mnemonic key shortcuts when the context
+	menu is visible.  Fixes bug 616739.
+
+2010-06-24  Dick Porter  <dporter at codicesoftware.com>
+
+	* Fix NullReferenceException when keyboard shortcut activates
+	disabled context menu item.  Fixes bug 615940.
+
+2010-06-22  Dick Porter  <dporter at codicesoftware.com>
+
+	* TextControl.cs, XplatUIX11.cs, XplatUICarbon.cs: Expand paint
+	regions slightly so that the full extents of text get painted.
+	Fixes bug 464464.
+
 2010-03-02  Carlos Alberto Cortez <calberto.cortez at gmail.com>
 
 	* X11Keyboard.cs: When handling the key events, sometimes calling
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/MenuAPI.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/MenuAPI.cs
index b412ac1..d73bce6 100644
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/MenuAPI.cs
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/MenuAPI.cs
@@ -115,8 +115,12 @@ namespace System.Windows.Forms {
 		{
 			if (menu is MainMenu)
 				pt = ScreenToMenu (menu, pt);
-			else
+			else {
+				if (menu.Wnd == null) {
+					return null;
+				}
 				pt = menu.Wnd.PointToClient (pt);
+			}
 			foreach (MenuItem item in menu.MenuItems) {
 				Rectangle rect = item.bounds;
 				if (rect.Contains (pt))
@@ -625,7 +629,7 @@ namespace System.Windows.Forms {
 		{
 			keynav_state = KeyNavState.Navigating;
 			MenuItem item = FindItemByKey (CurrentMenu, msg.WParam);
-			if ((item == null) || (GrabControl == null))
+			if ((item == null) || (GrabControl == null) || (GrabControl.ActiveTracker == null))
 				return false;
 
 			active = true;
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TextControl.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TextControl.cs
index 9ada43e..b06c2fa 100644
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TextControl.cs
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TextControl.cs
@@ -1691,8 +1691,12 @@ namespace System.Windows.Forms {
 		internal void GetVisibleLineIndexes (Rectangle clip, out int start, out int end)
 		{
 			if (multiline) {
-				start = GetLineByPixel(clip.Top + viewport_y - offset_y, false).line_no;
-				end = GetLineByPixel(clip.Bottom + viewport_y - offset_y, false).line_no;
+				/* Expand the region slightly to be sure to
+				 * paint the full extent of the line of text.
+				 * See bug 464464.
+				 */
+				start = GetLineByPixel(clip.Top + viewport_y - offset_y - 1, false).line_no;
+				end = GetLineByPixel(clip.Bottom + viewport_y - offset_y + 1, false).line_no;
 			} else {
 				start = GetLineByPixel(clip.Left + viewport_x - offset_x, false).line_no;
 				end = GetLineByPixel(clip.Right + viewport_x - offset_x, false).line_no;
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ThemeWin32Classic.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ThemeWin32Classic.cs
index 0bd84de..52720ba 100644
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ThemeWin32Classic.cs
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ThemeWin32Classic.cs
@@ -65,9 +65,13 @@ namespace System.Windows.Forms
 		#region	Principal Theme Methods
 		public ThemeWin32Classic ()
 		{			
+			ResetDefaults ();
+		}
+
+		public override void ResetDefaults() {
 			defaultWindowBackColor = this.ColorWindow;
 			defaultWindowForeColor = this.ColorControlText;
-            window_border_font = new Font(FontFamily.GenericSansSerif, 8.25f, FontStyle.Bold);
+			window_border_font = new Font(FontFamily.GenericSansSerif, 8.25f, FontStyle.Bold);
 			
 			/* Menu string formats */
 			string_format_menu_text = new StringFormat ();
@@ -87,11 +91,6 @@ namespace System.Windows.Forms
 			string_format_menu_menubar_text.HotkeyPrefix = HotkeyPrefix.Show;
 		}
 
-		public override void ResetDefaults() {
-			Console.WriteLine("NOT IMPLEMENTED: ResetDefault()");
-			//throw new NotImplementedException("Need to implement ResetDefaults() for Win32 theme");
-		}
-
 		public override bool DoubleBufferingSupported {
 			get {return true; }
 		}
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUICarbon.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUICarbon.cs
index 897fff4..2f7e157 100644
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUICarbon.cs
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUICarbon.cs
@@ -1533,7 +1533,11 @@ namespace System.Windows.Forms {
 				clip_region.MakeEmpty();
 
 				foreach (Rectangle r in hwnd.ClipRectangles) {
-					clip_region.Union (r);
+					/* Expand the region slightly.
+					 * See bug 464464.
+					 */
+					Rectangle r2 = Rectangle.FromLTRB (r.Left, r.Top, r.Right, r.Bottom + 1);
+					clip_region.Union (r2);
 				}
 
 				if (hwnd.UserClip != null) {
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIX11.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIX11.cs
index b64febd..da294d0 100644
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIX11.cs
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIX11.cs
@@ -4917,7 +4917,11 @@ namespace System.Windows.Forms {
 				clip_region.MakeEmpty();
 
 				foreach (Rectangle r in hwnd.ClipRectangles) {
-					clip_region.Union (r);
+					/* Expand the region slightly.
+					 * See bug 464464.
+					 */
+					Rectangle r2 = Rectangle.FromLTRB (r.Left, r.Top, r.Right, r.Bottom + 1);
+					clip_region.Union (r2);
 				}
 
 				if (hwnd.UserClip != null) {
diff --git a/mcs/class/Microsoft.Build.Engine/ChangeLog b/mcs/class/Microsoft.Build.Engine/ChangeLog
index 0052a55..11e68a3 100644
--- a/mcs/class/Microsoft.Build.Engine/ChangeLog
+++ b/mcs/class/Microsoft.Build.Engine/ChangeLog
@@ -1,3 +1,20 @@
+2010-04-06  Ankit Jain  <jankit at novell.com>
+
+	* Makefile (EXTRA_DISTFILES): Remove TestTasks.dll.config .
+
+2010-04-03  Ankit Jain  <jankit at novell.com>
+
+	* Makefile: Use the correct assembly name for MS.Build.Utilities*
+	for 3.5 and 4.0 profiles. Copy the .config files for the test
+	assembly.
+	Import tools/xbuild/xbuild_targets.make, which copies the target
+	and tasks file in the correct place, to allow running tests
+	with different toolsversion.
+	* Microsoft.Build.Engine.dll.sources: Add LogExtensions.cs,
+	Toolset.cs, ToolsetDefinitionLocations.cs and ToolsetCollection.cs .
+	* Test/test-config-file-net-3.5: New.
+	* Test/test-config-file-net-4.0: New.
+
 2010-02-19  Ankit Jain  <jankit at novell.com>
 
 	* Microsoft.Build.Engine.dll.sources: Add ProjectLoadSettings.cs .
diff --git a/mcs/class/Microsoft.Build.Engine/Makefile b/mcs/class/Microsoft.Build.Engine/Makefile
index d46bf87..07f9e6f 100644
--- a/mcs/class/Microsoft.Build.Engine/Makefile
+++ b/mcs/class/Microsoft.Build.Engine/Makefile
@@ -11,23 +11,56 @@ NO_TEST = yes
 NO_SIGN_ASSEMBLY = yes
 endif
 
+ifeq (3.5, $(FRAMEWORK_VERSION))
+NAME_SUFFIX = .v3.5
+else
+ifeq (4.0, $(FRAMEWORK_VERSION))
+NAME_SUFFIX = .v4.0
+endif
+endif
+
 LIB_MCS_FLAGS = \
 	/r:$(corlib)				\
 	/r:System.dll				\
+	/r:System.Core.dll		\
 	/r:System.Xml.dll			\
 	/r:Microsoft.Build.Framework.dll	\
-	/r:Microsoft.Build.Utilities.dll
+	/r:Microsoft.Build.Utilities$(NAME_SUFFIX).dll
 
 TEST_MCS_FLAGS = \
 	/r:Microsoft.Build.Framework.dll	\
-	/r:Microsoft.Build.Utilities.dll
+	/r:Microsoft.Build.Utilities$(NAME_SUFFIX).dll
 
 EXTRA_DISTFILES = \
 	Test/resources/TestTasks.cs		\
-	Test/resources/*.*proj
+	Test/resources/*.*proj	\
+	Test/test-config-file*
 
 Test/resources/TestTasks.dll: Test/resources/TestTasks.cs
-	$(CSCOMPILE) Test/resources/TestTasks.cs /r:Microsoft.Build.Framework.dll /r:Microsoft.Build.Utilities.dll /target:library
+	$(CSCOMPILE) Test/resources/TestTasks.cs /r:Microsoft.Build.Framework.dll /r:Microsoft.Build.Utilities$(NAME_SUFFIX).dll /target:library
+
+clean-local: clean-test-tasks
+
+clean-test-tasks:
+	rm -f Test/resources/TestTasks.dll	
+
+test-local: copy-config
+
+ifeq (net_4_0, $(PROFILE))
+copy-config:
+	cp Test/test-config-file-net-4.0 $(test_lib).config
+else
+ifeq (net_3_5, $(PROFILE))
+copy-config:
+	cp Test/test-config-file-net-3.5 $(test_lib).config
+else
+copy-config:
+endif
+endif
+
+export TESTING_MONO=a
+XBUILD_DIR=../../tools/xbuild
+include $(XBUILD_DIR)/xbuild_targets.make
 
 test-local: Test/resources/TestTasks.dll
 
diff --git a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BuildEngine.cs b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BuildEngine.cs
index 530685e..1d48f92 100644
--- a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BuildEngine.cs
+++ b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BuildEngine.cs
@@ -32,7 +32,7 @@ using System.Collections;
 using Microsoft.Build.Framework;
 
 namespace Microsoft.Build.BuildEngine {
-	internal class BuildEngine : IBuildEngine {
+	internal class BuildEngine : IBuildEngine2 {
 	
 		Engine	engine;
 		int	columnNumberOfTaskNode;
@@ -60,7 +60,16 @@ namespace Microsoft.Build.BuildEngine {
 				       IDictionary globalProperties,
 				       IDictionary targetOutputs)
 		{
+			return BuildProjectFile (projectFileName, targetNames, globalProperties, targetOutputs, null);
+		}
+
+		public bool BuildProjectFile (string projectFileName,
+				       string[] targetNames,
+				       IDictionary globalProperties,
+				       IDictionary targetOutputs, string toolsVersion)
+		{
 			if (String.IsNullOrEmpty (projectFileName)) {
+				project.ToolsVersion = toolsVersion;
 				return engine.BuildProject (project, targetNames, targetOutputs,
 						BuildSettings.DoNotResetPreviouslyBuiltTargets);
 			} else {
@@ -71,10 +80,21 @@ namespace Microsoft.Build.BuildEngine {
 							(string) de.Key, (string) de.Value,
 							PropertyType.Global));
 				return engine.BuildProjectFile (projectFileName,
-					targetNames, bpg, targetOutputs, BuildSettings.DoNotResetPreviouslyBuiltTargets);
+					targetNames, bpg, targetOutputs, BuildSettings.DoNotResetPreviouslyBuiltTargets, toolsVersion);
 			}
 		}
 
+		public bool BuildProjectFilesInParallel (string[] projectFileNames,
+					string [] targetNames,
+					IDictionary[] globalProperties,
+					IDictionary[] targetOutputsPerProject,
+					string[] toolsVersion,
+					bool useResultsCache,
+					bool unloadProjectsOnCompletion)
+		{
+			throw new NotImplementedException ();
+		}
+
 		// Raises a custom event to all registered loggers.
 		public void LogCustomEvent (CustomBuildEventArgs e)
 		{
@@ -84,7 +104,21 @@ namespace Microsoft.Build.BuildEngine {
 		// Raises an error to all registered loggers.
 		public void LogErrorEvent (BuildErrorEventArgs e)
 		{
-			engine.EventSource.FireErrorRaised (this, e);
+			if (ContinueOnError) {
+				// log the error as a warning
+				LogWarningEvent (new BuildWarningEventArgs (
+					e.Subcategory, e.Code, e.File, e.LineNumber, e.ColumnNumber,
+					e.EndLineNumber, e.EndColumnNumber, e.Message,
+					e.HelpKeyword, e.SenderName));
+
+				LogMessageEvent (new BuildMessageEventArgs (
+							"Previous error was converted to a warning as the " +
+							"task was called with ContinueOnError=true.",
+							null, null, MessageImportance.Normal));
+
+			} else {
+				engine.EventSource.FireErrorRaised (this, e);
+			}
 		}
 
 		// Raises a message event to all registered loggers.
@@ -114,6 +148,10 @@ namespace Microsoft.Build.BuildEngine {
 		public string ProjectFileOfTaskNode {
 			get { return taskfile; }
 		}
+
+		public bool IsRunningMultipleNodes {
+			get { return false; }
+		}
 		
 	}
 }
diff --git a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BuildTask.cs b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BuildTask.cs
index 9edeeb5..38bdad8 100644
--- a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BuildTask.cs
+++ b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BuildTask.cs
@@ -176,27 +176,31 @@ namespace Microsoft.Build.BuildEngine {
 		void LogError (string message,
 				     params object[] messageArgs)
 		{
-			BuildErrorEventArgs beea = new BuildErrorEventArgs (
-				null, null, null, 0, 0, 0, 0, String.Format (message, messageArgs),
-				null, null);
-			parentTarget.Project.ParentEngine.EventSource.FireErrorRaised (this, beea);
+			parentTarget.Project.ParentEngine.LogError (message, messageArgs);
 		}
 		
 		void LogMessage (MessageImportance importance,
 					string message,
 					params object[] messageArgs)
 		{
-			BuildMessageEventArgs bmea = new BuildMessageEventArgs (
-				String.Format (message, messageArgs), null,
-				null, importance);
-			parentTarget.Project.ParentEngine.EventSource.FireMessageRaised (this, bmea);
+			parentTarget.Project.ParentEngine.LogMessage (importance, message, messageArgs);
 		}
 
 		ITask InitializeTask ()
 		{
 			ITask task;
 			
-			task = (ITask)Activator.CreateInstance (this.Type);
+			try {
+				task = (ITask)Activator.CreateInstance (this.Type);
+			} catch (InvalidCastException) {
+				LogMessage (MessageImportance.Low, "InvalidCastException, ITask: {0} Task type: {1}",
+						typeof (ITask).AssemblyQualifiedName, this.Type.AssemblyQualifiedName);
+				throw;
+			}
+			parentTarget.Project.ParentEngine.LogMessage (
+					MessageImportance.Low,
+					"Using task {0} from {1}", Name, this.Type.AssemblyQualifiedName);
+
 			task.BuildEngine = new BuildEngine (parentTarget.Project.ParentEngine, parentTarget.Project,
 						parentTarget.TargetFile, 0, 0, ContinueOnError);
 			task_logger = new TaskLoggingHelper (task);
diff --git a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/ChangeLog b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/ChangeLog
index 2e4b799..577d438 100644
--- a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/ChangeLog
+++ b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/ChangeLog
@@ -1,3 +1,91 @@
+2010-07-09  Ankit Jain  <jankit at novell.com>
+
+	* Engine.cs: Define 4.0 toolset for non-NET_4_0 profiles also,
+	but fallback to 3.5 toolset there. This is required for the mono-2-6
+	branch, which doesn't lacks NET_4_0 .
+
+2010-06-04  Ankit Jain  <jankit at novell.com>
+
+	* Import.cs (EvaluateProjectPath): Add a hack to support multiple
+	msbuild extension paths. Paths can be specified via the environment
+	variable - $MSBuildExtensionsPath . ~/.config/xbuild/tasks is also
+	checked for extensions, besides the default location.
+	This explicitly looks for a "$(MSBuildExtensionsPath)" in the import
+	expression and tries to replace that with possible paths, till it
+	finds the file. In rest of the project, the property would resolve
+	to its single default value.
+
+2010-06-03  Ankit Jain  <jankit at novell.com>
+
+	* Engine.cs (GetLoadedProject): Return null if project not found.
+	Based on a patch by Dale Ragan <dale.ragan at sinesignal.com> .
+
+2010-05-28  Ankit Jain  <jankit at novell.com>
+
+	Fix bug #485841.
+	* DirectoryScanner.cs (ProcessInclude): Set %(RecursiveDir) only if
+	the '**' wildcard was found in the original Include.
+
+2010-04-10  Ankit Jain  <jankit at novell.com>
+
+	* Project.cs (InitializeProperties): Set MSBuildBinPath to the current
+	tools path.
+
+2010-04-10  Ankit Jain  <jankit at novell.com>
+
+	* TaskEngine.cs (Prepare): Throw InvalidProjectFileException instead of a generic
+	Exception.
+
+2010-04-10  Ankit Jain  <jankit at novell.com>
+
+	* ConsoleLogger.cs (EventsToString): If the target being executed is
+	from an imported file, then show that.
+
+2010-04-10  Ankit Jain  <jankit at novell.com>
+
+	* Project.cs: Add property MSBuildExtensionsPath32, used by silverlight
+	projects.
+
+2010-04-07  Ankit Jain  <jankit at novell.com>
+
+	* ConsoleLogger.cs: Dump items and properties when a project starts
+	to build. Useful for debugging.
+	* Engine.cs (LogProjectStarted): Set the properties and items also,
+	for the project started event.
+	* Project.cs (EvaluatedPropertiesAsDictionaryEntries): New.
+	(EvaluatedItemsByNameAsDictionaryEntries): New. Required for
+	ProjectStartedEvent .
+
+2010-04-03  Ankit Jain  <jankit at novell.com>
+
+	* BuildEngine.cs: Implement IBuildEngine2 instead of
+	IBuildEngine.
+	* BuildTasks.cs: Use the new extension methods for logging.
+	(InitializeTask): Emit a message informing about the assembly
+	from which the task is being loaded. Emit a useful debug message
+	incase of a InvalidCastException.
+	* Engine.cs: Add missing methods, constructors and properties related
+	to ToolsVersion support. Setup a default set of Toolsets.
+	Keep separate taskdbs' per ToolsVersion. The common tasks
+	would come from different *.tasks file, and use different
+	task assemblies.
+	(DefaultToolsVersion): Correctly set this based on the profile.
+	* LogExtensions.cs: New. Extension methods on Engine, for logging.
+	* Project.cs: Add missing methods/contructors/properties related
+	to ToolsVersion support. Add reserved properties -
+	MSBuildToolsPath and MSBuildToolsVersion .
+	* Toolset.cs: New.
+	* ToolsetCollection.cs: New.
+	* ToolsetDefinitionLocations.cs: New.
+
+2010-03-04  Ankit Jain  <jankit at novell.com>
+
+	* BuildEngine.cs (LogErrorEvent): Log as warning, if
+	ContinueOnError==true, and log a corresponding message.
+	* TargetBatchingImpl.cs: Refactor to share code between the
+	batched and unbatched case. If a task fails and
+	ContinueOnError==true, then ignore the failed state.
+
 2010-02-19  Ankit Jain  <jankit at novell.com>
 
 	* BuildItem.cs: Track api changes.
diff --git a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/ConsoleLogger.cs b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/ConsoleLogger.cs
index 8114c79..02d0179 100644
--- a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/ConsoleLogger.cs
+++ b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/ConsoleLogger.cs
@@ -29,6 +29,7 @@
 
 using System;
 using System.Runtime.InteropServices;
+using System.Collections;
 using System.Collections.Generic;
 using System.IO;
 using System.Security;
@@ -283,6 +284,8 @@ namespace Microsoft.Build.BuildEngine {
 						String.IsNullOrEmpty (args.TargetNames) ? "default" : args.TargetNames));
 			ResetColor ();
 			WriteLine (String.Empty);
+			DumpProperties (args.Properties);
+			DumpItems (args.Items);
 			PushEvent (args);
 		}
 		
@@ -405,7 +408,7 @@ namespace Microsoft.Build.BuildEngine {
 		public void CustomEventHandler (object sender, CustomBuildEventArgs args)
 		{
 		}
-		
+
 		private void WriteLine (string message)
 		{
 			if (indent > 0) {
@@ -436,6 +439,7 @@ namespace Microsoft.Build.BuildEngine {
 		{
 			StringBuilder sb = new StringBuilder ();
 
+			string last_imported_target_file = String.Empty;
 			for (int i = 0; i < events.Count; i ++) {
 				BuildStatusEventArgs args = events [i];
 				ProjectStartedEventArgs pargs = args as ProjectStartedEventArgs;
@@ -444,12 +448,20 @@ namespace Microsoft.Build.BuildEngine {
 							String.IsNullOrEmpty (pargs.TargetNames) ?
 								"default targets" :
 								pargs.TargetNames);
+					last_imported_target_file = String.Empty;
 					continue;
 				}
 
 				TargetStartedEventArgs targs = args as TargetStartedEventArgs;
-				if (targs != null)
+				if (targs != null) {
+					if (targs.TargetFile != targs.ProjectFile && targs.TargetFile != last_imported_target_file)
+						// target from an imported file,
+						// and it hasn't been mentioned as yet
+						sb.AppendFormat ("{0} ", targs.TargetFile);
+
+					last_imported_target_file = targs.TargetFile;
 					sb.AppendFormat ("({0} target) ->\n", targs.TargetName);
+				}
 			}
 
 			return sb.ToString ();
@@ -572,6 +584,59 @@ namespace Microsoft.Build.BuildEngine {
                 			return false;
                 }
 
+		void DumpProperties (IEnumerable properties)
+		{
+			if (!IsVerbosityGreaterOrEqual (LoggerVerbosity.Diagnostic))
+				return;
+
+			SetColor (eventColor);
+			WriteLine ("\n");
+			WriteLine ("Initial Properties:");
+			ResetColor ();
+
+			if (properties == null)
+				return;
+
+			var dict = new SortedDictionary<string, string> ();
+			foreach (DictionaryEntry de in properties)
+				dict [(string)de.Key] = (string)de.Value;
+
+			foreach (KeyValuePair<string, string> pair in dict)
+				WriteLine (String.Format ("{0} = {1}", pair.Key, pair.Value));
+			WriteLine ("\n");
+		}
+
+		void DumpItems (IEnumerable items)
+		{
+			if (!IsVerbosityGreaterOrEqual (LoggerVerbosity.Diagnostic) || items == null)
+				return;
+
+			SetColor (eventColor);
+			WriteLine ("\n");
+			WriteLine ("Initial Items:");
+			ResetColor ();
+			if (items == null)
+				return;
+
+			var items_table = new SortedDictionary<string, List<ITaskItem>> ();
+			foreach (DictionaryEntry de in items) {
+				string key = (string)de.Key;
+				if (!items_table.ContainsKey (key))
+					items_table [key] = new List<ITaskItem> ();
+
+				items_table [key].Add ((ITaskItem) de.Value);
+			}
+
+			foreach (string name in items_table.Keys) {
+				WriteLine (name);
+				indent ++;
+				foreach (ITaskItem item in items_table [name])
+					WriteLine (item.ItemSpec);
+				indent--;
+			}
+			WriteLine ("\n");
+		}
+
 		public string Parameters {
 			get {
 				return parameters;
diff --git a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/DirectoryScanner.cs b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/DirectoryScanner.cs
index 904a979..4215deb 100644
--- a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/DirectoryScanner.cs
+++ b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/DirectoryScanner.cs
@@ -114,10 +114,12 @@ namespace Microsoft.Build.BuildEngine {
 					if (!excludedItems.ContainsKey (fi.FullName)) {
 						TaskItem item = new TaskItem (include_item);
 						item.ItemSpec = fi.FullName;
-						string rec_dir = Path.GetDirectoryName (fi.FullName.Substring (wildcard_offset));
-						if (rec_dir.Length > 0)
-							rec_dir += Path.DirectorySeparatorChar;
-						item.SetMetadata ("RecursiveDir", rec_dir);
+						if (wildcard_offset >= 0) {
+							string rec_dir = Path.GetDirectoryName (fi.FullName.Substring (wildcard_offset));
+							if (rec_dir.Length > 0)
+								rec_dir += Path.DirectorySeparatorChar;
+							item.SetMetadata ("RecursiveDir", rec_dir);
+						}
 						includedItems.Add (item);
 					}
 				}
diff --git a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Engine.cs b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Engine.cs
index a8f6a06..1a113a2 100644
--- a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Engine.cs
+++ b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Engine.cs
@@ -40,16 +40,17 @@ namespace Microsoft.Build.BuildEngine {
 		
 		string			binPath;
 		bool			buildEnabled;
-		TaskDatabase		defaultTasks;
-		bool			defaultTasksRegistered;
+		Dictionary<string, TaskDatabase> defaultTasksTableByToolsVersion;
 		const string		defaultTasksProjectName = "Microsoft.Common.tasks";
 		EventSource		eventSource;
 		bool			buildStarted;
+		ToolsetDefinitionLocations toolsetLocations;
 		BuildPropertyGroup	global_properties;
 		//IDictionary		importedProjects;
 		List <ILogger>		loggers;
 		//bool			onlyLogCriticalEvents;
 		Dictionary <string, Project>	projects;
+		string defaultToolsVersion;
 
 		// the key here represents the project+target+global_properties set
 		Dictionary <string, ITaskItem[]> builtTargetsOutputByName;
@@ -68,6 +69,25 @@ namespace Microsoft.Build.BuildEngine {
 		{
 		}
 
+		public Engine (ToolsetDefinitionLocations locations)
+			: this (ToolLocationHelper.GetPathToDotNetFramework (TargetDotNetFrameworkVersion.Version20))
+		{
+			toolsetLocations = locations;
+		}
+		
+		public Engine (BuildPropertyGroup globalProperties)
+			: this (ToolLocationHelper.GetPathToDotNetFramework (TargetDotNetFrameworkVersion.Version20))
+		{
+			this.global_properties = globalProperties;
+		}
+
+		public Engine (BuildPropertyGroup globalProperties, ToolsetDefinitionLocations locations)
+			: this (ToolLocationHelper.GetPathToDotNetFramework (TargetDotNetFrameworkVersion.Version20))
+		{
+			this.global_properties = globalProperties;
+			toolsetLocations = locations;
+		}
+
 		// engine should be invoked with path where binary files are
 		// to find microsoft.build.tasks
 		public Engine (string binPath)
@@ -81,8 +101,28 @@ namespace Microsoft.Build.BuildEngine {
 			this.global_properties = new BuildPropertyGroup ();
 			this.builtTargetsOutputByName = new Dictionary<string, ITaskItem[]> ();
 			this.currentlyBuildingProjectsStack = new Stack<Project> ();
-			
-			RegisterDefaultTasks ();
+			this.Toolsets = new ToolsetCollection ();
+			LoadDefaultToolsets ();
+			defaultTasksTableByToolsVersion = new Dictionary<string, TaskDatabase> ();
+			GetDefaultTasks (DefaultToolsVersion);
+		}
+
+		//FIXME: should be loaded from config file
+		void LoadDefaultToolsets ()
+		{
+			Toolsets.Add (new Toolset ("2.0",
+						ToolLocationHelper.GetPathToDotNetFramework (TargetDotNetFrameworkVersion.Version20)));
+			Toolsets.Add (new Toolset ("3.0",
+						ToolLocationHelper.GetPathToDotNetFramework (TargetDotNetFrameworkVersion.Version30)));
+			Toolsets.Add (new Toolset ("3.5",
+						ToolLocationHelper.GetPathToDotNetFramework (TargetDotNetFrameworkVersion.Version35)));
+#if NET_4_0
+			Toolsets.Add (new Toolset ("4.0",
+						ToolLocationHelper.GetPathToDotNetFramework (TargetDotNetFrameworkVersion.Version40)));
+#else
+			Toolsets.Add (new Toolset ("4.0",
+						ToolLocationHelper.GetPathToDotNetFramework (TargetDotNetFrameworkVersion.Version35)));
+#endif
 		}
 		
 		[MonoTODO]
@@ -128,27 +168,31 @@ namespace Microsoft.Build.BuildEngine {
 			if (targetNames == null)
 				return false;
 
+			if (defaultToolsVersion != null)
+				// it has been explicitly set, xbuild does this..
+				project.ToolsVersion = defaultToolsVersion;
 			return project.Build (targetNames, targetOutputs, buildFlags);
 		}
 
 		[MonoTODO]
 		public bool BuildProjectFile (string projectFile)
 		{
-			throw new NotImplementedException ();
+			return BuildProjectFile (projectFile, new string [0]);
 		}
 		
 		[MonoTODO]
 		public bool BuildProjectFile (string projectFile,
 					      string targetName)
 		{
-			throw new NotImplementedException ();
+			return BuildProjectFile (projectFile,
+			                         targetName == null ? new string [0] : new string [] {targetName});
 		}
 		
 		[MonoTODO]
 		public bool BuildProjectFile (string projectFile,
 					      string[] targetNames)
 		{
-			throw new NotImplementedException ();
+			return BuildProjectFile (projectFile, targetNames, null);
 		}
 		
 		[MonoTODO]
@@ -174,6 +218,16 @@ namespace Microsoft.Build.BuildEngine {
 					      IDictionary targetOutputs,
 					      BuildSettings buildFlags)
 		{
+			return BuildProjectFile (projectFile, targetNames, globalProperties, targetOutputs, buildFlags, null);
+		}
+			
+		//FIXME: add a test for null @toolsVersion
+		public bool BuildProjectFile (string projectFile,
+					      string[] targetNames,
+					      BuildPropertyGroup globalProperties,
+					      IDictionary targetOutputs,
+					      BuildSettings buildFlags, string toolsVersion)
+		{
 			Project project;
 
 			if (projects.ContainsKey (projectFile)) {
@@ -197,6 +251,13 @@ namespace Microsoft.Build.BuildEngine {
 			}
 
 			try {
+				if (String.IsNullOrEmpty (toolsVersion) && defaultToolsVersion != null)
+					// it has been explicitly set, xbuild does this..
+					//FIXME: should this be cleared after building?
+					project.ToolsVersion = defaultToolsVersion;
+				else
+					project.ToolsVersion = toolsVersion;
+
 				return project.Build (targetNames, targetOutputs, buildFlags);
 			} finally {
 				if (globalProperties != null) {
@@ -217,8 +278,6 @@ namespace Microsoft.Build.BuildEngine {
 
 		public Project CreateNewProject ()
 		{
-			if (defaultTasksRegistered)
-				CheckBinPath ();
 			return new Project (this);
 		}
 
@@ -227,8 +286,10 @@ namespace Microsoft.Build.BuildEngine {
 			if (projectFullFileName == null)
 				throw new ArgumentNullException ("projectFullFileName");
 			
-			// FIXME: test it
-			return projects [projectFullFileName];
+			Project project;
+			projects.TryGetValue (projectFullFileName, out project);
+
+			return project;
 		}
 
 		internal void RemoveLoadedProject (Project p)
@@ -328,13 +389,15 @@ namespace Microsoft.Build.BuildEngine {
 
 		void LogProjectStarted (Project project, string [] target_names)
 		{
-			ProjectStartedEventArgs psea;
+			string targets;
 			if (target_names == null || target_names.Length == 0)
-				psea = new ProjectStartedEventArgs ("Project started.", null, project.FullFileName,
-						String.Empty, null, null);
+				targets = String.Empty;
 			else
-				psea = new ProjectStartedEventArgs ("Project started.", null, project.FullFileName,
-						String.Join (";", target_names), null, null);
+				targets = String.Join (";", target_names);
+
+			ProjectStartedEventArgs psea = new ProjectStartedEventArgs ("Project started.", null, project.FullFileName, targets,
+					project.EvaluatedPropertiesAsDictionaryEntries, project.EvaluatedItemsByNameAsDictionaryEntries);
+
 			eventSource.FireProjectStarted (this, psea);
 		}
 
@@ -358,23 +421,44 @@ namespace Microsoft.Build.BuildEngine {
 			bfea = new BuildFinishedEventArgs ("Build finished.", null, succeeded);
 			eventSource.FireBuildFinished (this, bfea);
 		}
+
+		internal TaskDatabase GetDefaultTasks (string toolsVersion)
+		{
+			TaskDatabase db;
+			if (defaultTasksTableByToolsVersion.TryGetValue (toolsVersion, out db))
+				return db;
+
+			var toolset = Toolsets [toolsVersion];
+			if (toolset == null)
+				throw new Exception ("Unknown toolsversion: " + toolsVersion);
+
+			string toolsPath = toolset.ToolsPath;
+			string tasksFile = Path.Combine (toolsPath, defaultTasksProjectName);
+			this.LogMessage (MessageImportance.Low, "Loading default tasks for ToolsVersion: {0} from {1}", toolsVersion, tasksFile);
+
+			// set a empty taskdb here, because the project loading the tasks
+			// file will try to get the default task db
+			defaultTasksTableByToolsVersion [toolsVersion] = new TaskDatabase ();
+
+			db = defaultTasksTableByToolsVersion [toolsVersion] = RegisterDefaultTasks (tasksFile);
+
+			return db;
+		}
 		
-		void RegisterDefaultTasks ()
+		TaskDatabase RegisterDefaultTasks (string tasksFile)
 		{
-			this.defaultTasksRegistered = false;
-			
 			Project defaultTasksProject = CreateNewProject ();
+			TaskDatabase db;
 			
-			if (binPath != null) {
-				if (File.Exists (Path.Combine (binPath, defaultTasksProjectName))) {
-					defaultTasksProject.Load (Path.Combine (binPath, defaultTasksProjectName));
-					defaultTasks = defaultTasksProject.TaskDatabase;
-				} else
-					defaultTasks = new TaskDatabase ();
-			} else
-				defaultTasks = new TaskDatabase ();
-			
-			this.defaultTasksRegistered = true;
+			if (File.Exists (tasksFile)) {
+				defaultTasksProject.Load (tasksFile);
+				db = defaultTasksProject.TaskDatabase;
+			} else {
+				this.LogWarning ("Default tasks file {0} not found, ignoring.", tasksFile);
+				db = new TaskDatabase ();
+			}
+
+			return db;
 		}
 
 		public string BinPath {
@@ -403,7 +487,31 @@ namespace Microsoft.Build.BuildEngine {
 			get { return global_properties; }
 			set { global_properties = value; }
 		}
+		
+		public ToolsetCollection Toolsets {
+			get; private set;
+		}
 
+		public string DefaultToolsVersion {
+			get {
+				if (String.IsNullOrEmpty (defaultToolsVersion))
+#if NET_4_0
+					return "4.0";
+#elif NET_3_5
+					return "3.5";
+#else
+					return "2.0";
+#endif
+				
+				return defaultToolsVersion;
+			}
+			set { defaultToolsVersion = value; }
+		}
+		
+		public bool IsBuilding {
+			get { return buildStarted; }
+		}
+		
 		public bool OnlyLogCriticalEvents {
 			get { return eventSource.OnlyLogCriticalEvents; }
 			set { eventSource.OnlyLogCriticalEvents = value; }
@@ -413,14 +521,6 @@ namespace Microsoft.Build.BuildEngine {
 			get { return eventSource; }
 		}
 		
-		internal bool DefaultTasksRegistered {
-			get { return defaultTasksRegistered; }
-		}
-		
-		internal TaskDatabase DefaultTasks {
-			get { return defaultTasks; }
-		}
-
 		internal Dictionary<string, ITaskItem[]> BuiltTargetsOutputByName {
 			get { return builtTargetsOutputByName; }
 		}
diff --git a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Import.cs b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Import.cs
index c35aa81..ecb45ae 100644
--- a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Import.cs
+++ b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Import.cs
@@ -31,12 +31,17 @@ using System;
 using System.IO;
 using System.Xml;
 
+using Microsoft.Build.Framework;
+
 namespace Microsoft.Build.BuildEngine {
 	public class Import {
 		XmlElement	importElement;
 		Project		project;
 		ImportedProject originalProject;
 		string		evaluatedProjectPath;
+
+		static string DotConfigExtensionsPath = Path.Combine (Environment.GetFolderPath (Environment.SpecialFolder.ApplicationData),
+								Path.Combine ("xbuild", "tasks"));
 	
 		internal Import (XmlElement importElement, Project project, ImportedProject originalProject)
 		{
@@ -82,10 +87,48 @@ namespace Microsoft.Build.BuildEngine {
 
 		string EvaluateProjectPath (string file)
 		{
-			Expression exp;
+			if (file.IndexOf ("$(MSBuildExtensionsPath)") >= 0) {
+				// This is a *HACK* to support multiple paths for
+				// MSBuildExtensionsPath property. Normally it would
+				// get resolved to a single value, but here we special
+				// case it and try ~/.config/xbuild/tasks and any
+				// paths specified in the env var $MSBuildExtensionsPath .
+				//
+				// The property itself will resolve to the default
+				// location though, so you get in any other part of the
+				// project.
+
+				string envvar = Environment.GetEnvironmentVariable ("MSBuildExtensionsPath");
+				envvar = (envvar ?? String.Empty) + ":" + DotConfigExtensionsPath;
 
-			exp = new Expression ();
-			exp.Parse (file, ParseOptions.Split);
+				string [] paths = envvar.Split (new char [] {':'}, StringSplitOptions.RemoveEmptyEntries);
+				foreach (string path in paths) {
+					if (!Directory.Exists (path)) {
+						project.ParentEngine.LogMessage (MessageImportance.Low, "Extension path '{0}' not found, ignoring.", path);
+						continue;
+					}
+
+					string pfile = Path.GetFullPath (file.Replace ("\\", "/").Replace (
+								"$(MSBuildExtensionsPath)", path + Path.DirectorySeparatorChar));
+
+					var evaluated_path = EvaluatePath (pfile);
+					if (File.Exists (evaluated_path)) {
+						project.ParentEngine.LogMessage (MessageImportance.Low,
+							"{0}: Importing project {1} from extension path {2}", project.FullFileName, evaluated_path, path);
+						return pfile;
+					}
+					project.ParentEngine.LogMessage (MessageImportance.Low,
+							"{0}: Couldn't find project {1} for extension path {2}", project.FullFileName, evaluated_path, path);
+				}
+			}
+
+			return EvaluatePath (file);
+		}
+
+		string EvaluatePath (string path)
+		{
+			var exp = new Expression ();
+			exp.Parse (path, ParseOptions.Split);
 			return (string) exp.ConvertTo (project, typeof (string));
 		}
 
diff --git a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/LogExtensions.cs b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/LogExtensions.cs
new file mode 100644
index 0000000..030ea8a
--- /dev/null
+++ b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/LogExtensions.cs
@@ -0,0 +1,183 @@
+//
+// LogExtensions.cs: Extension methods for logging on Engine
+//
+// Author:
+//	Ankit Jain (jankit at novell.com)
+//
+// Copyright 2010 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+#if NET_2_0
+
+using System;
+using System.IO;
+using System.Text;
+using Microsoft.Build.Framework;
+
+namespace Microsoft.Build.BuildEngine
+{
+	static class LogExtensions
+	{
+		public static string FormatString (string unformatted,
+						   params object[] args)
+		{
+			if (unformatted == null)
+				throw new ArgumentNullException ("unformatted");
+		
+			if (args == null || args.Length == 0)
+				return unformatted;
+			else
+				return String.Format (unformatted, args);
+		}
+		
+		public static void LogError (this Engine engine, string message,
+				     params object[] messageArgs)
+		{
+			if (message == null)
+				throw new ArgumentNullException ("message");
+				
+			BuildErrorEventArgs beea = new BuildErrorEventArgs (
+				null, null, null, 0, 0, 0, 0, FormatString (message, messageArgs),
+				null, null);
+			engine.EventSource.FireErrorRaised (engine, beea);
+		}
+
+		public static void LogError (this Engine engine, string subcategory, string errorCode,
+				      string helpKeyword, string file,
+				      int lineNumber, int columnNumber,
+				      int endLineNumber, int endColumnNumber,
+				      string message,
+				      params object[] messageArgs)
+		{
+			if (message == null)
+				throw new ArgumentNullException ("message");
+			
+			BuildErrorEventArgs beea = new BuildErrorEventArgs (
+				subcategory, errorCode, file, lineNumber,
+				columnNumber, endLineNumber, endColumnNumber,
+				FormatString (message, messageArgs), helpKeyword /*it's helpKeyword*/,
+				null /*it's senderName*/);
+
+			engine.EventSource.FireErrorRaised (engine, beea);
+		}
+
+		public static void LogErrorFromException (this Engine engine, Exception e)
+		{
+			LogErrorFromException (engine, e, true);
+		}
+
+		public static void LogErrorFromException (this Engine engine, Exception e,
+						   bool showStackTrace)
+		{
+			LogErrorFromException (engine, e, showStackTrace, true, String.Empty);
+		}
+
+		[MonoTODO ("Arguments @showDetail and @file are not honored")]
+		public static void LogErrorFromException (this Engine engine, Exception e,
+						   bool showStackTrace, bool showDetail, string file)
+		{
+			if (e == null)
+				throw new ArgumentNullException ("e");
+		
+			StringBuilder sb = new StringBuilder ();
+			sb.Append (e.Message);
+			if (showStackTrace == true)
+				sb.Append (e.StackTrace);
+			BuildErrorEventArgs beea = new BuildErrorEventArgs (
+				null, null, null, 0, 0, 0, 0, sb.ToString (),
+				e.HelpLink, e.Source);
+			engine.EventSource.FireErrorRaised (engine, beea);
+		}
+
+		public static void LogMessage (this Engine engine, string message,
+				       params object[] messageArgs)
+		{
+			LogMessage (engine, MessageImportance.Normal, message, messageArgs); 
+		}
+
+		public static void LogMessage (this Engine engine, MessageImportance importance,
+					string message,
+					params object[] messageArgs)
+		{
+			if (message == null)
+				throw new ArgumentNullException ("message");
+		
+			LogMessageFromText (engine, FormatString (message, messageArgs), importance);
+		}
+
+		public static bool LogMessageFromText (this Engine engine, string lineOfText,
+						MessageImportance importance)
+		{
+			if (lineOfText == null)
+				throw new ArgumentNullException ("lineOfText");
+
+			BuildMessageEventArgs bmea = new BuildMessageEventArgs (
+				lineOfText, null,
+				null, importance);
+			
+			engine.EventSource.FireMessageRaised (engine, bmea);
+
+			return true;
+		}
+
+		public static void LogWarning (this Engine engine, string message,
+				       params object[] messageArgs)
+		{
+			// FIXME: what about all the parameters?
+			BuildWarningEventArgs bwea = new BuildWarningEventArgs (
+				null, null, null, 0, 0, 0, 0, FormatString (message, messageArgs),
+				null, null);
+			engine.EventSource.FireWarningRaised (engine, bwea);
+		}
+
+		public static void LogWarning (this Engine engine, string subcategory, string warningCode,
+					string helpKeyword, string file,
+					int lineNumber, int columnNumber,
+					int endLineNumber, int endColumnNumber,
+					string message,
+					params object[] messageArgs)
+		{
+			BuildWarningEventArgs bwea = new BuildWarningEventArgs (
+				subcategory, warningCode, file, lineNumber,
+				columnNumber, endLineNumber, endColumnNumber,
+				FormatString (message, messageArgs), helpKeyword, null);
+			engine.EventSource.FireWarningRaised (engine, bwea);
+		}
+
+		public static void LogWarningFromException (this Engine engine, Exception e)
+		{
+			LogWarningFromException (engine, e, false);
+		}
+
+		public static void LogWarningFromException (this Engine engine, Exception e,
+						     bool showStackTrace)
+		{
+			StringBuilder sb = new StringBuilder ();
+			sb.Append (e.Message);
+			if (showStackTrace)
+				sb.Append (e.StackTrace);
+			LogWarning (engine, null, null, null, null, 0, 0, 0, 0,
+				sb.ToString (), null);
+		}
+	}
+}
+
+#endif
diff --git a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Project.cs b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Project.cs
index b5b0b1a..0bda5ab 100644
--- a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Project.cs
+++ b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Project.cs
@@ -89,9 +89,14 @@ namespace Microsoft.Build.BuildEngine {
 		{
 		}
 
-		public Project (Engine engine)
+		public Project (Engine engine) : this (engine, null)
+		{
+		}
+		
+		public Project (Engine engine, string toolsVersion)
 		{
 			parentEngine  = engine;
+			ToolsVersion = toolsVersion;
 
 			buildEnabled = ParentEngine.BuildEnabled;
 			xmlDocument = new XmlDocument ();
@@ -116,6 +121,7 @@ namespace Microsoft.Build.BuildEngine {
 				GlobalProperties.AddProperty (bp.Clone (true));
 			
 			ProcessXml ();
+
 		}
 
 		[MonoTODO ("Not tested")]
@@ -793,8 +799,7 @@ namespace Microsoft.Build.BuildEngine {
 			last_item_group_containing = new Dictionary <string, BuildItemGroup> ();
 			
 			taskDatabase = new TaskDatabase ();
-			if (ParentEngine.DefaultTasksRegistered)
-				taskDatabase.CopyTasks (ParentEngine.DefaultTasks);	
+			taskDatabase.CopyTasks (ParentEngine.GetDefaultTasks (GetToolsVersionToUse ()));
 
 			initialTargets = new List<string> ();
 			defaultTargets = new string [0];
@@ -860,7 +865,7 @@ namespace Microsoft.Build.BuildEngine {
 						AddChoose (xe);
 						break;
 					default:
-						throw new InvalidProjectFileException ("Invalid element in project file.");
+						throw new InvalidProjectFileException (String.Format ("Invalid element '{0}' in project file.", xe.Name));
 					}
 				}
 			}
@@ -927,9 +932,15 @@ namespace Microsoft.Build.BuildEngine {
 			EvaluatedProperties.AddProperty (new BuildProperty ("MSBuildProjectName",
 						Path.GetFileNameWithoutExtension (fullFileName),
 						PropertyType.Reserved));
-			EvaluatedProperties.AddProperty (new BuildProperty ("MSBuildBinPath", parentEngine.BinPath, PropertyType.Reserved));
-			EvaluatedProperties.AddProperty (new BuildProperty ("MSBuildToolsPath", parentEngine.BinPath, PropertyType.Reserved));
+			string toolsVersionToUse = GetToolsVersionToUse ();
+			string toolsPath = parentEngine.Toolsets [toolsVersionToUse].ToolsPath;
+			if (toolsPath == null)
+				throw new Exception ("Unknown toolsVersion: " + toolsVersionToUse);
+			EvaluatedProperties.AddProperty (new BuildProperty ("MSBuildBinPath", toolsPath, PropertyType.Reserved));
+			EvaluatedProperties.AddProperty (new BuildProperty ("MSBuildToolsPath", toolsPath, PropertyType.Reserved));
+			EvaluatedProperties.AddProperty (new BuildProperty ("MSBuildToolsVersion", toolsVersionToUse, PropertyType.Reserved));
 			EvaluatedProperties.AddProperty (new BuildProperty ("MSBuildExtensionsPath", ExtensionsPath, PropertyType.Reserved));
+			EvaluatedProperties.AddProperty (new BuildProperty ("MSBuildExtensionsPath32", ExtensionsPath, PropertyType.Reserved));
 			EvaluatedProperties.AddProperty (new BuildProperty ("MSBuildProjectDefaultTargets", DefaultTargets, PropertyType.Reserved));
 			EvaluatedProperties.AddProperty (new BuildProperty ("OS", OS, PropertyType.Environment));
 
@@ -942,6 +953,18 @@ namespace Microsoft.Build.BuildEngine {
 
 			EvaluatedProperties.AddProperty (new BuildProperty ("MSBuildProjectDirectory", projectDir, PropertyType.Reserved));
 		}
+
+		string GetToolsVersionToUse ()
+		{
+			if (String.IsNullOrEmpty (ToolsVersion)) {
+				if (HasToolsVersionAttribute)
+					return DefaultToolsVersion;
+				else
+					return parentEngine.DefaultToolsVersion;
+			} else {
+				return ToolsVersion;
+			}
+		}
 		
 		void AddProjectExtensions (XmlElement xmlElement)
 		{
@@ -1077,7 +1100,19 @@ namespace Microsoft.Build.BuildEngine {
 				return evaluatedItemsByName;
 			}
 		}
-		
+
+		internal IEnumerable EvaluatedItemsByNameAsDictionaryEntries {
+			get {
+				if (EvaluatedItemsByName.Count == 0)
+					yield break;
+
+				foreach (KeyValuePair<string, BuildItemGroup> pair in EvaluatedItemsByName) {
+					foreach (BuildItem bi in pair.Value)
+						yield return new DictionaryEntry (pair.Key, bi.ConvertToITaskItem (null, ExpressionOptions.ExpandItemRefs));
+				}
+			}
+		}
+
 		internal IDictionary <string, BuildItemGroup> EvaluatedItemsByNameIgnoringCondition {
 			get {
 				// FIXME: do we need to do this here?
@@ -1238,6 +1273,13 @@ namespace Microsoft.Build.BuildEngine {
 			}
 		}
 
+		internal IEnumerable EvaluatedPropertiesAsDictionaryEntries {
+			get {
+				foreach (BuildProperty bp in EvaluatedProperties)
+					yield return new DictionaryEntry (bp.Name, bp.Value);
+			}
+		}
+
 		public string FullFileName {
 			get { return fullFileName; }
 			set { fullFileName = value; }
@@ -1316,6 +1358,29 @@ namespace Microsoft.Build.BuildEngine {
 			get { return xmlDocument.InnerXml; }
 		}
 
+		// corresponds to the xml attribute
+		public string DefaultToolsVersion {
+			get {
+				if (xmlDocument != null)
+					return xmlDocument.DocumentElement.GetAttribute ("ToolsVersion");
+				return null;
+			}
+			set {
+				if (xmlDocument != null)
+					xmlDocument.DocumentElement.SetAttribute ("ToolsVersion", value);
+			}
+		}
+
+		public bool HasToolsVersionAttribute {
+			get {
+				return xmlDocument != null && xmlDocument.DocumentElement.HasAttribute ("ToolsVersion");
+			}
+		}
+		
+		public string ToolsVersion {
+			get; internal set;
+		}
+
 		internal List<string> BuiltTargetKeys {
 			get { return builtTargetKeys; }
 		}
diff --git a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/TargetBatchingImpl.cs b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/TargetBatchingImpl.cs
index e0d8d73..af8040e 100644
--- a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/TargetBatchingImpl.cs
+++ b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/TargetBatchingImpl.cs
@@ -83,68 +83,57 @@ namespace Microsoft.Build.BuildEngine {
 		bool Run (Target target, out bool executeOnErrors)
 		{
 			executeOnErrors = false;
-			if (buckets.Count > 0)
-				return RunBatched (target, out executeOnErrors);
-			else
-				return RunUnbatched (target, out executeOnErrors);
-		}
-
-		bool RunBatched (Target target, out bool executeOnErrors)
-		{
-			bool result = true;
-			executeOnErrors = false;
-			foreach (Dictionary<string, BuildItemGroup> bucket in buckets) {
-				LogTargetStarted (target);
-				project.PushBatch (bucket, commonItemsByName);
-				try {
-					if (!BuildTargetNeeded ()) {
-						LogTargetSkipped (target);
-						continue;
-					}
+			if (buckets.Count > 0) {
+				foreach (Dictionary<string, BuildItemGroup> bucket in buckets)
+					if (!RunTargetWithBucket (bucket, target, out executeOnErrors))
+						return false;
 
-					for (int i = 0; i < target.BuildTasks.Count; i ++) {
-						//FIXME: parsing attributes repeatedly
-						BuildTask task = target.BuildTasks [i];
-						result = new TaskBatchingImpl (project).Build (task, out executeOnErrors);
-						if (!result && !task.ContinueOnError) {
-							executeOnErrors = true;
-							break;
-						}
-					}
-				} finally {
-					project.PopBatch ();
-					LogTargetFinished (target, result);
-				}
+				return true;
+			} else {
+				return RunTargetWithBucket (null, target, out executeOnErrors);
 			}
-			return result;
 		}
 
-		bool RunUnbatched (Target target, out bool executeOnErrors)
+		bool RunTargetWithBucket (Dictionary<string, BuildItemGroup> bucket, Target target, out bool executeOnErrors)
 		{
-			bool result = true;
+			bool target_result = true;
 			executeOnErrors = false;
+
 			LogTargetStarted (target);
+			if (bucket != null)
+				project.PushBatch (bucket, commonItemsByName);
 			try {
 				if (!BuildTargetNeeded ()) {
 					LogTargetSkipped (target);
-					LogTargetFinished (target, true);
 					return true;
 				}
 
-				foreach (BuildTask bt in target.BuildTasks) {
+				for (int i = 0; i < target.BuildTasks.Count; i ++) {
+					//FIXME: parsing attributes repeatedly
+					BuildTask bt = target.BuildTasks [i];
+
 					TaskBatchingImpl batchingImpl = new TaskBatchingImpl (project);
-					result = batchingImpl.Build (bt, out executeOnErrors);
+					bool task_result = batchingImpl.Build (bt, out executeOnErrors);
+					if (task_result)
+						continue;
+
+					// task failed, if ContinueOnError,
+					// ignore failed state for target
+					target_result = bt.ContinueOnError;
 
-					if (!result && !bt.ContinueOnError) {
+					if (!bt.ContinueOnError) {
 						executeOnErrors = true;
-						break;
+						return false;
 					}
+
 				}
 			} finally {
-				LogTargetFinished (target, result);
+				if (bucket != null)
+					project.PopBatch ();
+				LogTargetFinished (target, target_result);
 			}
 
-			return result;
+			return target_result;
 		}
 
 		// Parse target's Input and Output attributes to get list of referenced
diff --git a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/TaskEngine.cs b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/TaskEngine.cs
index 485771d..696ffbe 100644
--- a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/TaskEngine.cs
+++ b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/TaskEngine.cs
@@ -95,7 +95,7 @@ namespace Microsoft.Build.BuildEngine {
 					if (TryGetObjectFromString (de.Value, currentProperty.PropertyType, out value))
 						values.Add (de.Key, value);
 				} catch (Exception e) {
-					throw new Exception (String.Format (
+					throw new InvalidProjectFileException (String.Format (
 							"Error converting Property named '{0}' with value '{1}' to type {2}: {3}",
 							de.Key, de.Value, currentProperty.PropertyType, e.Message), e);
 				}
@@ -171,10 +171,10 @@ namespace Microsoft.Build.BuildEngine {
 				propertyInfo = taskType.GetProperty (taskParameter, BindingFlags.Public | BindingFlags.Instance |
 							BindingFlags.IgnoreCase);
 				if (propertyInfo == null)
-					throw new Exception (String.Format (
+					throw new InvalidProjectFileException (String.Format (
 						"The parameter '{0}' was not found for the '{1}' task.", taskParameter, taskElement.Name));
 				if (!propertyInfo.IsDefined (outputAttribute, false))
-					throw new Exception ("This is not output property.");
+					throw new InvalidProjectFileException ("This is not output property.");
 				
 				o = propertyInfo.GetValue (task, null);
 				// FIXME: maybe we should throw an exception here?
diff --git a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Toolset.cs b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Toolset.cs
new file mode 100644
index 0000000..d795517
--- /dev/null
+++ b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Toolset.cs
@@ -0,0 +1,53 @@
+//
+// Toolset.cs
+//
+// Author:
+//	Ankit Jain (jankit at novell.com)
+//
+// Copyright 2010 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+#if NET_2_0
+using System;
+
+namespace Microsoft.Build.BuildEngine
+{
+	public class Toolset
+	{
+		public Toolset (string toolsVersion, string toolsPath, BuildPropertyGroup buildProperties)
+		{
+			ToolsVersion = toolsVersion;
+			ToolsPath = toolsPath;
+			BuildProperties = buildProperties;
+		}
+		
+		public Toolset (string toolsVersion, string toolsPath)
+			: this (toolsVersion, toolsPath, null)
+		{
+		}
+
+		public BuildPropertyGroup BuildProperties { get; private set; }
+
+		public string ToolsVersion { get; private set; }
+		public string ToolsPath { get; private set; }
+	}
+}
+#endif
diff --git a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/ToolsetCollection.cs b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/ToolsetCollection.cs
new file mode 100644
index 0000000..0c332d4
--- /dev/null
+++ b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/ToolsetCollection.cs
@@ -0,0 +1,99 @@
+//
+// ToolsetCollection.cs
+//
+// Author:
+//	Ankit Jain (jankit at novell.com)
+//
+// Copyright 2010 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+#if NET_2_0
+
+using System;
+using System.Collections.Generic;
+using System.Collections;
+
+namespace Microsoft.Build.BuildEngine
+{
+
+	public class ToolsetCollection : ICollection<Toolset>, IEnumerable<Toolset>, IEnumerable
+	{
+		List<Toolset> toolsets;
+		
+		internal ToolsetCollection ()
+		{
+			toolsets = new List<Toolset> ();
+		}
+		
+		public int Count
+		{
+			get { return toolsets.Count; }
+		}
+		
+		public bool IsReadOnly { get { return false; } }
+			
+		public Toolset this [string toolsVersion]
+		{
+			get { return toolsets.Find (item => item.ToolsVersion == toolsVersion); }
+		}
+		
+		public void Add (Toolset item)
+		{
+			toolsets.Add (item);
+		}
+		
+		public void Clear ()
+		{
+			toolsets.Clear ();
+		}
+		
+		public bool Contains (string toolsVersion)
+		{
+			return toolsets.Exists (item => item.ToolsVersion == toolsVersion);
+		}
+		
+		public bool Contains (Toolset item)
+		{
+			return toolsets.Contains (item);
+		}
+
+		public void CopyTo (Toolset[] array, int arrayIndex)
+		{
+			toolsets.CopyTo (array, arrayIndex);
+		}
+		
+		public IEnumerator<Toolset> GetEnumerator ()
+		{
+			return toolsets.GetEnumerator ();
+		}
+		
+		IEnumerator IEnumerable.GetEnumerator ()
+		{
+			return toolsets.GetEnumerator ();
+		}
+		
+		public bool Remove (Toolset item)
+		{
+			return toolsets.Remove (item);
+		}
+	}
+}
+#endif
diff --git a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/ToolsetDefinitionLocations.cs b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/ToolsetDefinitionLocations.cs
new file mode 100644
index 0000000..6f5e106
--- /dev/null
+++ b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/ToolsetDefinitionLocations.cs
@@ -0,0 +1,39 @@
+//
+// ToolsetDefinitionLocations.cs
+//
+// Author:
+//	Ankit Jain (jankit at novell.com)
+//
+// Copyright 2010 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+#if NET_2_0
+
+namespace Microsoft.Build.BuildEngine
+{
+	public enum ToolsetDefinitionLocations
+	{
+		None,
+		ConfigurationFile,
+		Registry
+	}
+}
+#endif
diff --git a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.Engine.dll.sources b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.Engine.dll.sources
index 8f429b3..02bc4c2 100644
--- a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.Engine.dll.sources
+++ b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.Engine.dll.sources
@@ -46,6 +46,7 @@ Microsoft.Build.BuildEngine/InternalLoggerException.cs
 Microsoft.Build.BuildEngine/InvalidProjectFileException.cs
 Microsoft.Build.BuildEngine/IReference.cs
 Microsoft.Build.BuildEngine/ItemReference.cs
+Microsoft.Build.BuildEngine/LogExtensions.cs
 Microsoft.Build.BuildEngine/MetadataReference.cs
 Microsoft.Build.BuildEngine/Project.cs
 Microsoft.Build.BuildEngine/ProjectLoadSettings.cs
@@ -56,6 +57,9 @@ Microsoft.Build.BuildEngine/Target.cs
 Microsoft.Build.BuildEngine/TaskDatabase.cs
 Microsoft.Build.BuildEngine/TaskEngine.cs
 Microsoft.Build.BuildEngine/Token.cs
+Microsoft.Build.BuildEngine/Toolset.cs
+Microsoft.Build.BuildEngine/ToolsetCollection.cs
+Microsoft.Build.BuildEngine/ToolsetDefinitionLocations.cs
 Microsoft.Build.BuildEngine/UsingTask.cs
 Microsoft.Build.BuildEngine/UsingTaskCollection.cs
 Microsoft.Build.BuildEngine/Utilities.cs
diff --git a/mcs/class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine/ChangeLog b/mcs/class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine/ChangeLog
index 7a11426..a35b494 100644
--- a/mcs/class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine/ChangeLog
+++ b/mcs/class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine/ChangeLog
@@ -1,3 +1,16 @@
+2010-06-03  Ankit Jain  <jankit at novell.com>
+
+	* EngineTest.cs (TestGetLoadedProject1):
+	Patch by Dale Ragan <dale.ragan at sinesignal.com> .
+
+2010-04-06  Ankit Jain  <jankit at novell.com>
+
+	* Consts.cs (ToolsVersionString): New.
+	(GetTasksAsmPath): New.
+	* EngineTest.cs: Use the direct path to the tasks assembly
+	in the UsingTasks.
+	* ProjectTest.cs: Set ToolsVersion to the current profile.
+
 2010-02-19  Ankit Jain  <jankit at novell.com>
 
 	* ImportTest.cs (TestMissingImport*): Add new tests for missing
diff --git a/mcs/class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine/Consts.cs b/mcs/class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine/Consts.cs
index bae9a32..31a1608 100644
--- a/mcs/class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine/Consts.cs
+++ b/mcs/class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine/Consts.cs
@@ -26,6 +26,7 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
 using System;
+using System.IO;
 using Microsoft.Build.Utilities;
 
 public static class Consts {
@@ -43,4 +44,27 @@ public static class Consts {
 				return ToolLocationHelper.GetPathToDotNetFramework (TargetDotNetFrameworkVersion.Version20);
 		}
 	}
+
+	public static string ToolsVersionString {
+		get {
+#if NET_4_0
+			return " ToolsVersion='4.0'";
+#elif NET_3_5
+			return " ToolsVersion='3.5'";
+#else
+			return String.Empty;
+#endif
+		}
+	}
+
+	public static string GetTasksAsmPath ()
+	{
+#if NET_4_0
+		return Path.Combine (ToolLocationHelper.GetPathToDotNetFramework (TargetDotNetFrameworkVersion.Version40), "Microsoft.Build.Tasks.v4.0.dll");
+#elif NET_3_5
+		return Path.Combine (ToolLocationHelper.GetPathToDotNetFramework (TargetDotNetFrameworkVersion.Version35), "Microsoft.Build.Tasks.v3.5.dll");
+#else
+		return Path.Combine (ToolLocationHelper.GetPathToDotNetFramework (TargetDotNetFrameworkVersion.Version20), "Microsoft.Build.Tasks.dll");
+#endif
+	}
 }
diff --git a/mcs/class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine/EngineTest.cs b/mcs/class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine/EngineTest.cs
index e18e464..49f229e 100644
--- a/mcs/class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine/EngineTest.cs
+++ b/mcs/class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine/EngineTest.cs
@@ -324,8 +324,9 @@ namespace MonoTests.Microsoft.Build.BuildEngine {
 		[Test]
 		public void TestGlobalProperties1 ()
 		{
-			string mainProject = @"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"">
-	<UsingTask TaskName=""Microsoft.Build.Tasks.MSBuild"" AssemblyName=""Microsoft.Build.Tasks, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"" />
+			string mainProject = @"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"">"
+				+ GetUsingTask ("MSBuild")
+				+ @"
 	<Target Name=""main"">
 		<MSBuild Projects=""first.proj"" Targets = ""1;2""/>
 		<Message Text=""second""/>
@@ -333,9 +334,9 @@ namespace MonoTests.Microsoft.Build.BuildEngine {
 	</Target>
 </Project>";
 
-			string firstProject = @"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"">
-	<UsingTask TaskName=""Microsoft.Build.Tasks.MSBuild""
-		AssemblyName=""Microsoft.Build.Tasks, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"" />
+			string firstProject = @"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"">"
+				+ GetUsingTask ("MSBuild")
+				+ @"
 	<Target Name = ""1"">
 		<MSBuild Projects=""second.proj"" Properties=""foo=bar""/>
 		<MSBuild Projects=""second.proj"" Targets = ""TargetB"" Properties=""foo=foofoo""/>
@@ -363,8 +364,9 @@ namespace MonoTests.Microsoft.Build.BuildEngine {
 		public void TestGlobalProperties1a ()
 		{
 			Directory.CreateDirectory ("Test/resources/foo");
-			string mainProject = @"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"">
-	<UsingTask TaskName=""Microsoft.Build.Tasks.MSBuild"" AssemblyName=""Microsoft.Build.Tasks, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"" />
+			string mainProject = @"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"">"
+					+ GetUsingTask ("MSBuild")
+					+ @"
 	<Target Name=""main"">
 		<MSBuild Projects=""first.proj"" Targets = ""1;2""/>
 		<Message Text=""second""/>
@@ -372,9 +374,9 @@ namespace MonoTests.Microsoft.Build.BuildEngine {
 	</Target>
 </Project>";
 
-			string firstProject = @"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"">
-	<UsingTask TaskName=""Microsoft.Build.Tasks.MSBuild""
-		AssemblyName=""Microsoft.Build.Tasks, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"" />
+			string firstProject = @"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"">"
+					+ GetUsingTask ("MSBuild")
+					+ @"
 	<Target Name = ""1"">
 		<MSBuild Projects=""second.proj"" Properties=""foo=bar""/>
 		<MSBuild Projects=""second.proj"" Targets = ""TargetB"" Properties=""foo=foofoo""/>
@@ -401,8 +403,9 @@ namespace MonoTests.Microsoft.Build.BuildEngine {
 		[Test]
 		public void TestGlobalProperties1b ()
 		{
-			string mainProject = @"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"">
-	<UsingTask TaskName=""Microsoft.Build.Tasks.MSBuild"" AssemblyName=""Microsoft.Build.Tasks, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"" />
+			string mainProject = @"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"">"
+					+ GetUsingTask ("MSBuild")
+					+ @"
 	<Target Name=""main"">
 		<MSBuild Projects=""first.proj"" Targets = ""1;2""/>
 		<Message Text=""second""/>
@@ -410,9 +413,9 @@ namespace MonoTests.Microsoft.Build.BuildEngine {
 	</Target>
 </Project>";
 
-			string firstProject = @"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"">
-	<UsingTask TaskName=""Microsoft.Build.Tasks.MSBuild""
-		AssemblyName=""Microsoft.Build.Tasks, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"" />
+			string firstProject = @"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"">"
+					+ GetUsingTask ("MSBuild")
+					+ @"
 	<Target Name = ""1"">
 		<MSBuild Projects=""second.proj"" Properties=""foo=bar""/>
 		<MSBuild Projects=""second.proj""/>
@@ -439,8 +442,9 @@ namespace MonoTests.Microsoft.Build.BuildEngine {
 		[Test]
 		public void TestGlobalProperties2 ()
 		{
-			string mainProject = @"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"">
-	<UsingTask TaskName=""Microsoft.Build.Tasks.MSBuild"" AssemblyName=""Microsoft.Build.Tasks, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"" />
+			string mainProject = @"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"">"
+					+ GetUsingTask ("MSBuild")
+					+ @"
 	<Target Name=""main"">
 		<MSBuild Projects=""first.proj"" Targets = ""1""/>
 		<MSBuild Projects=""first.proj"" Targets = ""2""/>
@@ -449,9 +453,9 @@ namespace MonoTests.Microsoft.Build.BuildEngine {
 	</Target>
 </Project>";
 
-			string firstProject = @"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"">
-	<UsingTask TaskName=""Microsoft.Build.Tasks.MSBuild""
-		AssemblyName=""Microsoft.Build.Tasks, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"" />
+			string firstProject = @"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"">"
+					+ GetUsingTask ("MSBuild")
+					+ @"
 	<Target Name = ""1"">
 		<MSBuild Projects=""second.proj"" Properties=""foo=bar""/>
 		<MSBuild Projects=""second.proj"" Targets = ""TargetB"" Properties=""foo=foofoo""/>
@@ -478,8 +482,9 @@ namespace MonoTests.Microsoft.Build.BuildEngine {
 		[Test]
 		public void TestGlobalProperties3 ()
 		{
-			string mainProject = @"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"">
-	<UsingTask TaskName=""Microsoft.Build.Tasks.MSBuild"" AssemblyName=""Microsoft.Build.Tasks, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"" />
+			string mainProject = @"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"">"
+					+ GetUsingTask ("MSBuild")
+					+ @"
 	<Target Name=""main"">
 		<MSBuild Projects=""first.proj"" Targets = ""1""/>
 		<CallTarget Targets=""Call2""/>
@@ -491,9 +496,9 @@ namespace MonoTests.Microsoft.Build.BuildEngine {
 	</Target>
 </Project>";
 
-			string firstProject = @"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"">
-	<UsingTask TaskName=""Microsoft.Build.Tasks.MSBuild""
-		AssemblyName=""Microsoft.Build.Tasks, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"" />
+			string firstProject = @"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"">"
+					+ GetUsingTask ("MSBuild")
+					+ @"
 	<Target Name = ""1"">
 		<MSBuild Projects=""second.proj"" Properties=""foo=bar""/>
 		<MSBuild Projects=""second.proj"" Targets = ""TargetB"" Properties=""foo=foofoo""/>
@@ -521,8 +526,9 @@ namespace MonoTests.Microsoft.Build.BuildEngine {
 		[Test]
 		public void TestGlobalProperties4 ()
 		{
-			string mainProject = @"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"">
-	<UsingTask TaskName=""Microsoft.Build.Tasks.MSBuild"" AssemblyName=""Microsoft.Build.Tasks, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"" />
+			string mainProject = @"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"">"
+					+ GetUsingTask ("MSBuild")
+					+ @"
 	<Target Name=""main"">
 		<MSBuild Projects=""first.proj"" Targets = ""1""/>
 		<CallTarget Targets=""Call2""/>
@@ -534,9 +540,9 @@ namespace MonoTests.Microsoft.Build.BuildEngine {
 	</Target>
 </Project>";
 
-			string firstProject = @"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"">
-	<UsingTask TaskName=""Microsoft.Build.Tasks.MSBuild""
-		AssemblyName=""Microsoft.Build.Tasks, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"" />
+			string firstProject = @"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"">"
+					+ GetUsingTask ("MSBuild")
+					+ @"
 	<Target Name = ""1"">
 		<MSBuild Projects=""second.proj"" Properties=""foo=bar""/>
 		<MSBuild Projects=""second.proj"" Targets = ""TargetB"" Properties=""foo=foofoo""/>
@@ -568,8 +574,9 @@ namespace MonoTests.Microsoft.Build.BuildEngine {
 		[Test]
 		public void TestGlobalProperties4a ()
 		{
-			string mainProject = @"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"">
-	<UsingTask TaskName=""Microsoft.Build.Tasks.MSBuild"" AssemblyName=""Microsoft.Build.Tasks, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"" />
+			string mainProject = @"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"">"
+					+ GetUsingTask ("MSBuild")
+					+ @"
 	<Target Name=""main"">
 		<MSBuild Projects=""first.proj"" Targets = ""1""/>
 		<CallTarget Targets=""Call2""/>
@@ -581,9 +588,9 @@ namespace MonoTests.Microsoft.Build.BuildEngine {
 	</Target>
 </Project>";
 
-			string firstProject = @"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"">
-	<UsingTask TaskName=""Microsoft.Build.Tasks.MSBuild""
-		AssemblyName=""Microsoft.Build.Tasks, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"" />
+			string firstProject = @"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"">"
+					+ GetUsingTask ("MSBuild")
+					+ @"
 	<Target Name = ""1"">
 		<MSBuild Projects=""second.proj"" Properties=""foo=bar""/>
 		<MSBuild Projects=""second.proj"" Targets = ""TargetB"" Properties=""foo=foofoo""/>
@@ -615,8 +622,9 @@ namespace MonoTests.Microsoft.Build.BuildEngine {
 		[Test]
 		public void TestGlobalProperties4b ()
 		{
-			string mainProject = @"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"">
-	<UsingTask TaskName=""Microsoft.Build.Tasks.MSBuild"" AssemblyName=""Microsoft.Build.Tasks, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"" />
+			string mainProject = @"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"">"
+					+ GetUsingTask ("MSBuild")
+					+ @"
 	<Target Name=""main"">
 		<MSBuild Projects=""first.proj"" Targets = ""1""/>
 		<CallTarget Targets=""Call2""/>
@@ -628,9 +636,9 @@ namespace MonoTests.Microsoft.Build.BuildEngine {
 	</Target>
 </Project>";
 
-			string firstProject = @"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"">
-	<UsingTask TaskName=""Microsoft.Build.Tasks.MSBuild""
-		AssemblyName=""Microsoft.Build.Tasks, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"" />
+			string firstProject = @"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"">"
+					+ GetUsingTask ("MSBuild")
+					+ @"
 	<Target Name = ""1"">
 		<MSBuild Projects=""second.proj"" Properties=""foo=bar""/>
 		<MSBuild Projects=""second.proj"" Targets = ""TargetB"" Properties=""foo=foofoo""/>
@@ -666,8 +674,9 @@ namespace MonoTests.Microsoft.Build.BuildEngine {
 		[Test]
 		public void TestGlobalProperties4c ()
 		{
-			string mainProject = @"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"">
-	<UsingTask TaskName=""Microsoft.Build.Tasks.MSBuild"" AssemblyName=""Microsoft.Build.Tasks, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"" />
+			string mainProject = @"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"">"
+					+ GetUsingTask ("MSBuild")
+					+ @"
 	<Target Name=""main"">
 		<MSBuild Projects=""first.proj"" Targets = ""1""/>
 		<CallTarget Targets=""Call2""/>
@@ -679,9 +688,9 @@ namespace MonoTests.Microsoft.Build.BuildEngine {
 	</Target>
 </Project>";
 
-			string firstProject = @"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"">
-	<UsingTask TaskName=""Microsoft.Build.Tasks.MSBuild""
-		AssemblyName=""Microsoft.Build.Tasks, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"" />
+			string firstProject = @"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"">"
+					+ GetUsingTask ("MSBuild")
+					+ @"
 	<Target Name = ""1"">
 		<MSBuild Projects=""second.proj"" Properties=""foo=bar""/>
 		<MSBuild Projects=""second.proj"" Targets = ""TargetB"" Properties=""foo=foofoo""/>
@@ -714,10 +723,9 @@ namespace MonoTests.Microsoft.Build.BuildEngine {
 		[Test]
 		public void TestMSBuildOutputs ()
 		{
-			string mainProject = @"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"">
-			<UsingTask TaskName=""Microsoft.Build.Tasks.MSBuild""
-					AssemblyName=""Microsoft.Build.Tasks, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"" />
-
+			string mainProject = @"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"">"
+					+ GetUsingTask ("MSBuild")
+					+ @"
         <ItemGroup>
                 <ProjectRef Include=""first.proj"">
                         <Prop3>value</Prop3>
@@ -802,6 +810,13 @@ namespace MonoTests.Microsoft.Build.BuildEngine {
 				});
 		}
 
+		[Test]
+		public void TestGetLoadedProject1()
+		{
+			Project project = Engine.GlobalEngine.GetLoadedProject("foo.proj");
+			Assert.IsNull(project);
+		}
+
 		// Helper Methods for TestGlobalProperties*
 
 		void CreateAndCheckGlobalPropertiesTest (string main, string first, string second,
@@ -889,6 +904,9 @@ namespace MonoTests.Microsoft.Build.BuildEngine {
 			}
 		}
 
-
+		public static string GetUsingTask (string taskName)
+		{
+			return "<UsingTask TaskName='Microsoft.Build.Tasks." + taskName + "' AssemblyFile='" + Consts.GetTasksAsmPath () + "' />";
+		}
 	}
 }
diff --git a/mcs/class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine/ProjectTest.cs b/mcs/class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine/ProjectTest.cs
index cce13c6..5d92a43 100644
--- a/mcs/class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine/ProjectTest.cs
+++ b/mcs/class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine/ProjectTest.cs
@@ -1779,7 +1779,7 @@ namespace MonoTests.Microsoft.Build.BuildEngine {
 			Engine engine = new Engine (Consts.BinPath);
 			Project project = engine.CreateNewProject ();
 
-			string second = @"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"" ToolsVersion=""3.5"">
+			string second = @"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"" " + Consts.ToolsVersionString + @">
 	<PropertyGroup>
 	  <Prop1>InitialVal</Prop1>
 	</PropertyGroup>
@@ -1797,7 +1797,7 @@ namespace MonoTests.Microsoft.Build.BuildEngine {
 				sw.Write (second);
 			}
 
-			string third = @"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"" ToolsVersion=""3.5"">
+			string third = @"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"" " + Consts.ToolsVersionString + @">
 	<PropertyGroup>
 	  <ThirdProp>Third Value</ThirdProp>
 	</PropertyGroup>
@@ -1972,7 +1972,7 @@ namespace MonoTests.Microsoft.Build.BuildEngine {
 		[Test]
 		public void TestCaseSensitivityOfProjectElements ()
 		{
-			string projectXml = @"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"" ToolsVersion=""3.5"">
+			string projectXml = @"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"" " + Consts.ToolsVersionString + @">
         <ItemGroup>
                 <Abc Include=""foo"">
                         <MetaDaTA1>md1</MetaDaTA1>
diff --git a/mcs/class/Microsoft.Build.Engine/Test/test-config-file-net-3.5 b/mcs/class/Microsoft.Build.Engine/Test/test-config-file-net-3.5
new file mode 100644
index 0000000..7756bca
--- /dev/null
+++ b/mcs/class/Microsoft.Build.Engine/Test/test-config-file-net-3.5
@@ -0,0 +1,15 @@
+<?xml version ="1.0"?>
+<configuration>
+    <runtime>
+        <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
+            <dependentAssembly>
+                <assemblyIdentity name="Microsoft.Build.Framework" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
+                <bindingRedirect oldVersion="0.0.0.0-99.9.9.9" newVersion="3.5.0.0"/>
+            </dependentAssembly>
+            <dependentAssembly>
+                <assemblyIdentity name="Microsoft.Build.Engine" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
+                <bindingRedirect oldVersion="0.0.0.0-99.9.9.9" newVersion="3.5.0.0"/>
+            </dependentAssembly>
+        </assemblyBinding>
+    </runtime>
+</configuration>
diff --git a/mcs/class/Microsoft.Build.Engine/Test/test-config-file-net-4.0 b/mcs/class/Microsoft.Build.Engine/Test/test-config-file-net-4.0
new file mode 100644
index 0000000..3c78f3b
--- /dev/null
+++ b/mcs/class/Microsoft.Build.Engine/Test/test-config-file-net-4.0
@@ -0,0 +1,15 @@
+<?xml version ="1.0"?>
+<configuration>
+    <runtime>
+        <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
+            <dependentAssembly>
+                <assemblyIdentity name="Microsoft.Build.Framework" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
+                <bindingRedirect oldVersion="0.0.0.0-99.9.9.9" newVersion="4.0.0.0"/>
+            </dependentAssembly>
+            <dependentAssembly>
+                <assemblyIdentity name="Microsoft.Build.Engine" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
+                <bindingRedirect oldVersion="0.0.0.0-99.9.9.9" newVersion="4.0.0.0"/>
+            </dependentAssembly>
+        </assemblyBinding>
+    </runtime>
+</configuration>
diff --git a/mcs/class/Microsoft.Build.Engine/Test/various/Build.cs b/mcs/class/Microsoft.Build.Engine/Test/various/Build.cs
index 12a5bcc..e11bd39 100644
--- a/mcs/class/Microsoft.Build.Engine/Test/various/Build.cs
+++ b/mcs/class/Microsoft.Build.Engine/Test/various/Build.cs
@@ -137,5 +137,57 @@ namespace MonoTests.Microsoft.Build.BuildEngine.Various {
 			Assert.IsNotNull (project.EvaluatedProperties ["A"], "A2");
 			Assert.IsNull (project.EvaluatedProperties ["B"], "A3");
 		}
+
+		[Test]
+		public void TestBuildContinueOnError ()
+		{
+			Engine engine;
+			Project project;
+
+			string documentString = @"
+				<Project xmlns='http://schemas.microsoft.com/developer/msbuild/2003'>
+					<Target Name='A'>
+						<Error ContinueOnError='true' Text='text' />
+						<CreateProperty Value='A'>
+							<Output TaskParameter='Value' PropertyName='A'/>
+						</CreateProperty>
+						<Error ContinueOnError='true' Text='text' />
+					</Target>
+				</Project>
+			";
+
+			engine = new Engine (Consts.BinPath);
+			project = engine.CreateNewProject ();
+			project.LoadXml (documentString);
+
+			Assert.IsTrue (project.Build ("A"), "A1");
+			Assert.IsNotNull (project.EvaluatedProperties["A"], "A2");
+		}
+
+		[Test]
+		public void TestBuildContinueOnErrorFalse ()
+		{
+			Engine engine;
+			Project project;
+
+			string documentString = @"
+				<Project xmlns='http://schemas.microsoft.com/developer/msbuild/2003'>
+					<Target Name='A'>
+						<Error ContinueOnError='false' Text='text' />
+						<CreateProperty Value='A'>
+							<Output TaskParameter='Value' PropertyName='A'/>
+						</CreateProperty>
+					</Target>
+				</Project>
+			";
+
+			engine = new Engine (Consts.BinPath);
+			project = engine.CreateNewProject ();
+			project.LoadXml (documentString);
+
+			Assert.IsFalse (project.Build ("A"), "A1");
+			Assert.IsNull (project.EvaluatedProperties["A"], "A2");
+		}
+
 	}
 }
diff --git a/mcs/class/Microsoft.Build.Engine/Test/various/ChangeLog b/mcs/class/Microsoft.Build.Engine/Test/various/ChangeLog
index d459cc7..02476d6 100644
--- a/mcs/class/Microsoft.Build.Engine/Test/various/ChangeLog
+++ b/mcs/class/Microsoft.Build.Engine/Test/various/ChangeLog
@@ -1,3 +1,7 @@
+2010-03-04  Ankit Jain  <jankit at novell.com>
+
+	* Build.cs (TestBuildContinueOnError*): New.
+
 2010-02-19  Ankit Jain  <jankit at novell.com>
 
 	* Items.cs (TestItemsWithWildcards): Check for RecursiveDir metadata also.
diff --git a/mcs/class/Microsoft.Build.Framework/ChangeLog b/mcs/class/Microsoft.Build.Framework/ChangeLog
index 74073fb..dea0641 100644
--- a/mcs/class/Microsoft.Build.Framework/ChangeLog
+++ b/mcs/class/Microsoft.Build.Framework/ChangeLog
@@ -1,3 +1,10 @@
+2010-04-03  Ankit Jain  <jankit at novell.com>
+
+	* Makefile: Import tools/xbuild/xbuild_targets.make, which copies
+	the target and tasks file in the correct place, to allow running
+	tests with different toolsversion.
+	* Microsoft.Build.Framework.dll.sources: Add IBuildEngine2.cs .
+
 2006-04-19  Marek Sieradzki  <marek.sieradzki at gmail.com>
 
 	* Microsoft.Build.Framework.targets: Removed.
diff --git a/mcs/class/Microsoft.Build.Framework/Makefile b/mcs/class/Microsoft.Build.Framework/Makefile
index 7404340..0cb68bf 100644
--- a/mcs/class/Microsoft.Build.Framework/Makefile
+++ b/mcs/class/Microsoft.Build.Framework/Makefile
@@ -17,5 +17,9 @@ LIB_MCS_FLAGS = \
 
 include ../../build/library.make
 
+export TESTING_MONO=a
+XBUILD_DIR=../../tools/xbuild
+include $(XBUILD_DIR)/xbuild_targets.make
+
 EXTRA_DISTFILES = \
 	Mono.XBuild.Framework/AssemblyLoadInfo.cs
diff --git a/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework.dll.sources b/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework.dll.sources
index 5be4904..7e7d3a5 100644
--- a/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework.dll.sources
+++ b/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework.dll.sources
@@ -20,6 +20,7 @@ Microsoft.Build.Framework/CustomBuildEventHandler.cs
 Microsoft.Build.Framework/ExternalProjectFinishedEventArgs.cs
 Microsoft.Build.Framework/ExternalProjectStartedEventArgs.cs
 Microsoft.Build.Framework/IBuildEngine.cs
+Microsoft.Build.Framework/IBuildEngine2.cs
 Microsoft.Build.Framework/IEventSource.cs
 Microsoft.Build.Framework/ILogger.cs
 Microsoft.Build.Framework/ITask.cs
diff --git a/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework/ChangeLog b/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework/ChangeLog
index 47cfed8..0f14e7b 100644
--- a/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework/ChangeLog
+++ b/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework/ChangeLog
@@ -1,3 +1,7 @@
+2010-04-03  Ankit Jain  <jankit at novell.com>
+
+	* IBuildEngine2.cs: New.
+
 2006-12-19  Marek Sieradzki  <marek.sieradzi at gmail.com>
 
 	* LoggerException.cs: Changed serialization names.
diff --git a/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework/IBuildEngine2.cs b/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework/IBuildEngine2.cs
new file mode 100644
index 0000000..42b456c
--- /dev/null
+++ b/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework/IBuildEngine2.cs
@@ -0,0 +1,59 @@
+//
+// IBuildEngine2.cs: Provides a way for task authors to use the functionality
+// of the MSBuild engine.
+//
+// Author:
+//	Ankit Jain (jankit at novell.com)
+//
+// Copyright 2010 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+#if NET_2_0
+
+using System;
+using System.Collections;
+
+namespace Microsoft.Build.Framework
+{
+	public interface IBuildEngine2 : IBuildEngine
+	{
+		// Initiates a build of a project file. If the build is
+		// successful, the outputs (if any) of the specified targets
+		// are returned.
+		bool BuildProjectFile (string projectFileName,
+				       string[] targetNames,
+				       IDictionary globalProperties,
+				       IDictionary targetOutputs, string toolsVersion);
+
+		bool BuildProjectFilesInParallel (string[] projectFileNames,
+					string [] targetNames,
+					IDictionary[] globalProperties,
+					IDictionary[] targetOutputsPerProject,
+					string[] toolsVersion,
+					bool useResultsCache,
+					bool unloadProjectsOnCompletion);
+
+		bool IsRunningMultipleNodes { get; }
+
+	}
+}
+
+#endif
diff --git a/mcs/class/Microsoft.Build.Tasks/ChangeLog b/mcs/class/Microsoft.Build.Tasks/ChangeLog
index 7e8c05a..ff531ad 100644
--- a/mcs/class/Microsoft.Build.Tasks/ChangeLog
+++ b/mcs/class/Microsoft.Build.Tasks/ChangeLog
@@ -1,3 +1,14 @@
+2010-04-03  Ankit Jain  <jankit at novell.com>
+
+	* Makefile: Import tools/xbuild/xbuild_targets.make, which copies
+	the target and tasks file in the correct place, to allow running
+	tests with different toolsversion. Copy the config file for the
+	test assembly. Clean the generated test.dll .
+	Use the correct target assembly name for 4.0 profile
+	(ms.build.tasks.v4.0.dll), and for Utilities assembly.
+	* Microsoft.Build.Tasks_test.dll.sources: Use Consts.cs from Engine
+	instead of maintaining a copy here.
+
 2010-03-02  Ankit Jain  <jankit at novell.com>
 
 	Fix tests.
diff --git a/mcs/class/Microsoft.Build.Tasks/Makefile b/mcs/class/Microsoft.Build.Tasks/Makefile
index 70d2cb6..34a542a 100644
--- a/mcs/class/Microsoft.Build.Tasks/Makefile
+++ b/mcs/class/Microsoft.Build.Tasks/Makefile
@@ -14,6 +14,10 @@ else
 
 ifeq (3.5, $(FRAMEWORK_VERSION))
 NAME_SUFFIX = .v3.5
+else
+ifeq (4.0, $(FRAMEWORK_VERSION))
+NAME_SUFFIX = .v4.0
+endif
 endif
 
 LIBRARY_NAME = Microsoft.Build.Tasks$(NAME_SUFFIX).dll
@@ -26,7 +30,7 @@ LIB_MCS_FLAGS = \
 	/r:System.Core.dll			\
 	/r:System.Xml.dll			\
 	/r:System.Windows.Forms.dll		\
-	/r:Microsoft.Build.Utilities.dll	\
+	/r:Microsoft.Build.Utilities$(NAME_SUFFIX).dll	\
 	/r:Microsoft.Build.Framework.dll	\
 	/r:Microsoft.Build.Engine.dll
 
@@ -39,11 +43,35 @@ EXTRA_DISTFILES = \
 	Test/resources/test.cs \
 	Test/resources/Sample.cs \
 	Test/resources/Sample.vb \
-	Test/resources/junk.txt
+	Test/resources/junk.txt \
+	Test/test-config-file*
 
 test-local: Test/resources/test.dll
 
 Test/resources/test.dll: Test/resources/test.cs
 	$(CSCOMPILE) -target:library Test/resources/test.cs
 
+clean-local: clean-test-dll
+
+clean-test-dll:
+	rm -f Test/resources/test.dll
+
+test-local: copy-config
+
+ifeq (net_4_0, $(PROFILE))
+copy-config:
+	cp Test/test-config-file-net-4.0 $(test_lib).config
+else
+ifeq (net_3_5, $(PROFILE))
+copy-config:
+	cp Test/test-config-file-net-3.5 $(test_lib).config
+else
+copy-config:
+endif
+endif
+
+export TESTING_MONO=a
+XBUILD_DIR=../../tools/xbuild
+include $(XBUILD_DIR)/xbuild_targets.make
+
 include ../../build/library.make
diff --git a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/AssemblyResolver.cs b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/AssemblyResolver.cs
index d356814..ae822e6 100644
--- a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/AssemblyResolver.cs
+++ b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/AssemblyResolver.cs
@@ -130,7 +130,7 @@ namespace Microsoft.Build.Tasks {
 
 			KeyValuePair<AssemblyName, string> pair;
 			if (gac_asm.NameToAssemblyNameCache.TryGetValue (key_aname.Name, out pair)) {
-				if (AssemblyNamesCompatible (key_aname, pair.Key, specific_version, true)) {
+				if (AssemblyNamesCompatible (key_aname, pair.Key, specific_version)) {
 					// gac and tgt frmwk refs are not copied private
 					return GetResolvedReference (reference, pair.Value, pair.Key, false,
 							SearchPath.TargetFrameworkDirectory);
@@ -146,40 +146,55 @@ namespace Microsoft.Build.Tasks {
 			return null;
 		}
 
-		public ResolvedReference FindInDirectory (ITaskItem reference, string directory, string [] file_extensions)
+		// Look for %(Identity).{dll|exe|..}
+		// if specific_version==true
+		// 	resolve if assembly names match
+		// else
+		// 	resolve the valid assembly
+		public ResolvedReference FindInDirectory (ITaskItem reference, string directory, string [] file_extensions, bool specific_version)
 		{
-			if (reference.ItemSpec.IndexOf (',') < 0) {
-				// Try as a filename
-				string path = Path.Combine (directory, reference.ItemSpec);
-				AssemblyName aname = GetAssemblyNameFromFile (path);
-				if (aname != null)
-					return GetResolvedReference (reference, path, aname, true, SearchPath.Directory);
-
-				foreach (string extn in file_extensions) {
-					string path_with_extn = path + extn;
-					aname = GetAssemblyNameFromFile (path_with_extn);
-					if (aname != null)
-						return GetResolvedReference (reference, path_with_extn, aname, true,
-								SearchPath.Directory);
-				}
-			}
+			string filename = reference.ItemSpec;
+			int comma_pos = filename.IndexOf (',');
+			if (comma_pos >= 0)
+				filename = filename.Substring (0, comma_pos);
 
-			// Probably an assembly name
-			AssemblyName key_aname = new AssemblyName (reference.ItemSpec);
+			// Try as a filename
+			string path = Path.GetFullPath (Path.Combine (directory, filename));
+			AssemblyName aname = specific_version ? new AssemblyName (reference.ItemSpec) : null;
+
+			ResolvedReference resolved_ref = ResolveReferenceForPath (path, reference, aname, null, SearchPath.Directory, specific_version);
+			if (resolved_ref != null)
+				return resolved_ref;
+
+			// try path + Include + {.dll|.exe|..}
 			foreach (string extn in file_extensions) {
-				foreach (string file in Directory.GetFiles (directory, "*" + extn)) {
-					AssemblyName found_aname = GetAssemblyNameFromFile (file);
-					if (found_aname == null)
-						// error already logged
-						continue;
-
-					//FIXME: Extract 'name' and look only for name.dll name.exe ?
-					if (AssemblyNamesCompatible (key_aname, found_aname, false))
-						return GetResolvedReference (reference, file, found_aname, true,
-								SearchPath.Directory);
-
-					LogSearchMessage ("Considered {0}, but assembly name wasn't compatible.", file);
-				}
+				resolved_ref = ResolveReferenceForPath (path + extn, reference, aname, null, SearchPath.Directory, specific_version);
+				if (resolved_ref != null)
+					return resolved_ref;
+			}
+
+			return null;
+		}
+
+		// tries to resolve reference from the given file path, and compares assembly names
+		// if @specific_version == true, and logs accordingly
+		ResolvedReference ResolveReferenceForPath (string filename, ITaskItem reference, AssemblyName aname,
+					string error_message, SearchPath spath, bool specific_version)
+		{
+			AssemblyName found_aname = GetAssemblyNameFromFile (filename);
+			if (found_aname == null) {
+				if (error_message != null)
+					log.LogMessage (MessageImportance.Low, error_message);
+				return null;
+			}
+
+			if (!specific_version || AssemblyNamesCompatible (aname, found_aname, specific_version)) {
+				// Check compatibility only if specific_version == true
+				return GetResolvedReference (reference, filename, found_aname, true, spath);
+			} else {
+				LogSearchMessage ("Considered '{0}', but assembly name '{1}' did not match the " +
+						"expected '{2}' (SpecificVersion={3})", filename, found_aname, aname, specific_version);
+				log.LogMessage (MessageImportance.Low, "Assembly names are not compatible.");
 			}
 
 			return null;
@@ -190,8 +205,9 @@ namespace Microsoft.Build.Tasks {
 			TargetFrameworkAssemblies gac_asm = new TargetFrameworkAssemblies (directory);
 			foreach (string file in Directory.GetFiles (directory, "*.dll")) {
 				AssemblyName aname = GetAssemblyNameFromFile (file);
-				gac_asm.NameToAssemblyNameCache [aname.Name] =
-					new KeyValuePair<AssemblyName, string> (aname, file);
+				if (aname != null)
+					gac_asm.NameToAssemblyNameCache [aname.Name] =
+						new KeyValuePair<AssemblyName, string> (aname, file);
 			}
 
 			return gac_asm;
@@ -256,11 +272,13 @@ namespace Microsoft.Build.Tasks {
 			return rr;
 		}
 
+		// HintPath has a valid assembly
+		// if specific_version==true
+		// 	resolve if assembly names match
+		// else
+		// 	resolve the valid assembly
 		public ResolvedReference ResolveHintPathReference (ITaskItem reference, bool specific_version)
 		{
-			AssemblyName name = new AssemblyName (reference.ItemSpec);
-			ResolvedReference resolved = null;
-
 			string hintpath = reference.GetMetadata ("HintPath");
 			if (String.IsNullOrEmpty (hintpath)) {
 				LogSearchMessage ("HintPath attribute not found");
@@ -273,21 +291,9 @@ namespace Microsoft.Build.Tasks {
 				return null;
 			}
 
-			AssemblyName found = GetAssemblyNameFromFile (hintpath);
-			if (found == null) {
-				log.LogMessage (MessageImportance.Low, "File at HintPath {0}, is either an invalid assembly or the file does not exist.", hintpath);
-				return null;
-			}
-
-			if (AssemblyNamesCompatible (name, found, specific_version)) {
-				resolved = GetResolvedReference (reference, hintpath, found, true, SearchPath.HintPath);
-			} else {
-				LogSearchMessage ("Considered {0}, but assembly name '{1}' did not match the " +
-						"expected '{2}' (SpecificVersion={3})", hintpath, found, name, specific_version);
-				log.LogMessage (MessageImportance.Low, "Assembly names are not compatible.");
-			}
-
-			return resolved;
+			return ResolveReferenceForPath (hintpath, reference, new AssemblyName (reference.ItemSpec),
+						String.Format ("File at HintPath {0}, is either an invalid assembly or the file does not exist.", hintpath),
+						SearchPath.HintPath, specific_version);
 		}
 
 		public AssemblyName GetAssemblyNameFromFile (string filename)
@@ -309,7 +315,7 @@ namespace Microsoft.Build.Tasks {
 
 		internal static bool AssemblyNamesCompatible (AssemblyName a, AssemblyName b, bool specificVersion)
 		{
-			return AssemblyNamesCompatible (a, b, specificVersion, false);
+			return AssemblyNamesCompatible (a, b, specificVersion, true);
 		}
 
 		// if @specificVersion is true then match full name, else just the simple name
diff --git a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/ChangeLog b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/ChangeLog
index 3104cf5..12a3248 100644
--- a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/ChangeLog
+++ b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/ChangeLog
@@ -1,3 +1,75 @@
+2010-06-09  Ankit Jain  <jankit at novell.com>
+
+	* ToolTask.cs: Don't check for tool's existence, as we might
+	not have the full path.
+
+2010-05-28  Ankit Jain  <jankit at novell.com>
+
+	* AssemblyResolver.cs: Add some comments.
+
+2010-05-28  Ankit Jain  <jankit at novell.com>
+
+	* AssemblyResolver.cs (FindInDirectory): Add a 'specific_version'
+	parameter. Look for reference.{dll|exe} instead of checking all
+	files in the directory. Compare assembly names only if
+	specific_version is true.
+	(ResolveHintPathReference): Extract code to check and compare assembly
+	names to ..
+	(ResolvedReferenceFromPath): .. this.
+	(AssemblyNamesCompatible): Change default value of @specificVersion to
+	true.
+	Track api changes.
+	* ResolveAssemblyReference.cs (ResolveReference): Specify
+	'specific_version' in case of SearchPath.Directory.
+	(TryGetSpecificVersionValue): msbuild seems to look only for ',' in
+	the reference, instead of checking whether the assembly is strong
+	named.
+	(TryGetResolvedReferenceByAssemblyName): Track api changes.
+
+2010-05-28  Ankit Jain  <jankit at novell.com>
+
+	* AssemblyResolver.cs (PopulateTargetFrameworkAssemblies):
+	Handle invalid dll, add a null check.
+
+2010-04-10  Ankit Jain  <jankit at novell.com>
+
+	* GetFrameworkPath.cs (FrameworkVersion40Path): New.
+
+2010-04-10  Ankit Jain  <jankit at novell.com>
+
+	* Copy.cs: Cleanly log errors, instead of throwing exceptions.
+
+2010-04-10  Ankit Jain  <jankit at novell.com>
+
+	* Vbc.cs (LogEventsFromTextOutput):
+	* ToolTask.cs (LogEventsFromTextOutput): Emit the messages
+	that don't match the error regex, as is.
+
+2010-04-08  Ankit Jain  <jankit at novell.com>
+
+	* Copy.cs: Handle non-existant source files.
+
+2010-04-08  Ankit Jain  <jankit at novell.com>
+
+	Fix bug #594541
+	* Vbc.cs (LogEventsFromTextOutput): Override and correctly parse
+	output. Taken regex from monodevelop for this.
+
+2010-04-08  Ankit Jain  <jankit at novell.com>
+
+	* Vbc.cs (ValidateParameters): Always return true, dummy implementation.
+
+2010-04-07  Ankit Jain  <jankit at novell.com>
+
+	* MSBuild.cs: Emit global properties, if any. Sort the property
+	list.
+
+2010-04-03  Ankit Jain  <jankit at novell.com>
+
+	* Csc.cs: Use dmcs as the compiler for 4.0 profile.
+	* MSBuild.cs (ToolsVersion): New.
+	Use toolsVersion for building.
+
 2010-02-10  Ankit Jain  <jankit at novell.com>
 
 	* GenerateResource.cs (CompileResourceFile): Check File.Exists
diff --git a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/Copy.cs b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/Copy.cs
index f704bce..a090e47 100644
--- a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/Copy.cs
+++ b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/Copy.cs
@@ -57,10 +57,16 @@ namespace Microsoft.Build.Tasks {
 				List <ITaskItem> temporaryCopiedFiles = new List <ITaskItem> ();
 			
 				if (sourceFiles != null && destinationFiles != null &&
-					sourceFiles.Length != destinationFiles.Length)
-					throw new Exception ("Number of source files is different than number of destination files.");
-				if (destinationFiles != null && destinationFolder != null)
-					throw new Exception ("You must specify only one attribute from DestinationFiles and DestinationFolder");
+					sourceFiles.Length != destinationFiles.Length) {
+					Log.LogError ("Number of source files is different than number of destination files.");
+					return false;
+				}
+
+				if (destinationFiles != null && destinationFolder != null) {
+					Log.LogError ("You must specify only one attribute from DestinationFiles and DestinationFolder");
+					return false;
+				}
+
 				if (destinationFiles != null && destinationFiles.Length > 0) {
 					for (int i = 0; i < sourceFiles.Length; i ++) {
 						ITaskItem sourceItem = sourceFiles [i];
@@ -68,6 +74,11 @@ namespace Microsoft.Build.Tasks {
 						string sourceFile = sourceItem.GetMetadata ("FullPath");
 						string destinationFile = destinationItem.GetMetadata ("FullPath");
 
+						if (!File.Exists (sourceFile)) {
+							Log.LogError ("Cannot copy {0} to {1}, as the source file doesn't exist.", sourceFile, destinationFile);
+							continue;
+						}
+
 						if (!skipUnchangedFiles || HasFileChanged (sourceFile, destinationFile))
 							CopyFile (sourceFile, destinationFile, true);
 
@@ -85,6 +96,11 @@ namespace Microsoft.Build.Tasks {
 						string filename = sourceItem.GetMetadata ("Filename") + sourceItem.GetMetadata ("Extension");
 						string destinationFile = Path.Combine (destinationDirectory,filename);
 
+						if (!File.Exists (sourceFile)) {
+							Log.LogError ("Cannot copy {0} to {1}, as the source file doesn't exist.", sourceFile, destinationFile);
+							continue;
+						}
+
 						if (!skipUnchangedFiles || directoryCreated ||
 							HasFileChanged (sourceFile, destinationFile))
 							CopyFile (sourceFile, destinationFile, false);
@@ -99,7 +115,8 @@ namespace Microsoft.Build.Tasks {
 					}
 					destinationFiles = temporaryDestinationFiles.ToArray ();
 				} else {
-					throw new Exception ("You must specify DestinationFolder or DestinationFiles attribute.");
+					Log.LogError ("You must specify DestinationFolder or DestinationFiles attribute.");
+					return false;
 				}
 				
 				copiedFiles = temporaryCopiedFiles.ToArray ();
diff --git a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/Csc.cs b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/Csc.cs
index 8b4217a..9839966 100644
--- a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/Csc.cs
+++ b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/Csc.cs
@@ -187,7 +187,11 @@ namespace Microsoft.Build.Tasks {
 
 		protected override string ToolName {
 			get {
+#if NET_4_0
+				return Utilities.RunningOnWindows ? "dmcs.bat" : "dmcs";
+#else
 				return Utilities.RunningOnWindows ? "gmcs.bat" : "gmcs";
+#endif
 			}
 		}
 
diff --git a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/GetFrameworkPath.cs b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/GetFrameworkPath.cs
index f32d527..07e6169 100644
--- a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/GetFrameworkPath.cs
+++ b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/GetFrameworkPath.cs
@@ -87,6 +87,15 @@ namespace Microsoft.Build.Tasks {
 			}
 		}
 
+#if NET_4_0
+		[Output]
+		public string FrameworkVersion40Path {
+			get {
+				return ToolLocationHelper.GetPathToDotNetFramework (
+						TargetDotNetFrameworkVersion.Version40);
+			}
+		}
+#endif
 	}
 }
 
diff --git a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/MSBuild.cs b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/MSBuild.cs
index 592a412..90c54cd 100644
--- a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/MSBuild.cs
+++ b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/MSBuild.cs
@@ -65,9 +65,14 @@ namespace Microsoft.Build.Tasks {
 			string currentDirectory = Environment.CurrentDirectory;
 			Hashtable outputs;
 		
-			Dictionary<string, string> global_properties = SplitPropertiesToDictionary ();
+			var global_properties = SplitPropertiesToDictionary ();
 			Dictionary<string, ITaskItem> projectsByFileName = new Dictionary<string, ITaskItem> ();
 
+			Log.LogMessage (MessageImportance.Low, "Global Properties:");
+			if (global_properties != null)
+				foreach (KeyValuePair<string, string> pair in global_properties)
+					Log.LogMessage (MessageImportance.Low, "\t{0} = {1}", pair.Key, pair.Value);
+
 			foreach (ITaskItem project in projects) {
 				filename = project.GetMetadata ("FullPath");
 				if (!File.Exists (filename)) {
@@ -82,7 +87,14 @@ namespace Microsoft.Build.Tasks {
 				outputs = new Hashtable ();
 
 				try {
-					result = BuildEngine.BuildProjectFile (filename, targets, global_properties, outputs);
+					// Order of precedence:
+					// %(Project.ToolsVersion) , ToolsVersion property
+					string tv = project.GetMetadata ("ToolsVersion");
+					if (String.IsNullOrEmpty (tv))
+						tv = ToolsVersion;
+					ThrowIfNotValidToolsVersion (tv);
+
+					result = BuildEngine2.BuildProjectFile (filename, targets, global_properties, outputs, tv);
 				} catch (InvalidProjectFileException e) {
 					Log.LogError ("Error building project {0}: {1}", filename, e.Message);
 					result = false;
@@ -127,6 +139,12 @@ namespace Microsoft.Build.Tasks {
 			return result;
 		}
 
+		void ThrowIfNotValidToolsVersion (string toolsVersion)
+		{
+			if (!String.IsNullOrEmpty (toolsVersion) && Engine.GlobalEngine.Toolsets [toolsVersion] == null)
+				throw new Exception (String.Format ("Unknown ToolsVersion : {0}", toolsVersion));
+		}
+
 		[Required]
 		public ITaskItem [] Projects {
 			get { return projects; }
@@ -170,12 +188,16 @@ namespace Microsoft.Build.Tasks {
 			set { buildInParallel = value; }
 		}
 
-		Dictionary<string, string> SplitPropertiesToDictionary ()
+		public string ToolsVersion {
+			get; set;
+		}
+
+		SortedDictionary<string, string> SplitPropertiesToDictionary ()
 		{
 			if (properties == null)
 				return null;
 
-			Dictionary<string, string> global_properties = new Dictionary<string, string> ();
+			var global_properties = new SortedDictionary<string, string> ();
 			foreach (string kvpair in properties) {
 				if (String.IsNullOrEmpty (kvpair))
 					continue;
diff --git a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/ResolveAssemblyReference.cs b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/ResolveAssemblyReference.cs
index 4f7665d..ee39d77 100644
--- a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/ResolveAssemblyReference.cs
+++ b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/ResolveAssemblyReference.cs
@@ -221,7 +221,8 @@ namespace Microsoft.Build.Tasks {
 				} else {
 					resolved = assembly_resolver.FindInDirectory (
 							item, spath,
-							allowedAssemblyExtensions ?? default_assembly_extensions);
+							allowedAssemblyExtensions ?? default_assembly_extensions,
+							specific_version);
 				}
 
 				if (resolved != null)
@@ -239,10 +240,13 @@ namespace Microsoft.Build.Tasks {
 			specific_version = true;
 			string value = item.GetMetadata ("SpecificVersion");
 			if (String.IsNullOrEmpty (value)) {
-				AssemblyName name = new AssemblyName (item.ItemSpec);
+				//AssemblyName name = new AssemblyName (item.ItemSpec);
 				// If SpecificVersion is not specified, then
 				// it is true if the Include is a strong name else false
-				specific_version = assembly_resolver.IsStrongNamed (name);
+				//specific_version = assembly_resolver.IsStrongNamed (name);
+
+				// msbuild seems to just look for a ',' in the name :/
+				specific_version = item.ItemSpec.IndexOf (',') >= 0;
 				return true;
 			}
 
@@ -460,7 +464,7 @@ namespace Microsoft.Build.Tasks {
 				return false;
 
 			// match for full name
-			if (AssemblyResolver.AssemblyNamesCompatible (key_aname, found_ref.AssemblyName, true))
+			if (AssemblyResolver.AssemblyNamesCompatible (key_aname, found_ref.AssemblyName, true, false))
 				// exact match, so its already there, dont add anything
 				return true;
 
diff --git a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/Vbc.cs b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/Vbc.cs
index 66c0889..52a8da8 100644
--- a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/Vbc.cs
+++ b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/Vbc.cs
@@ -31,6 +31,7 @@
 using System;
 using System.IO;
 using System.Text;
+using System.Text.RegularExpressions;
 
 using Microsoft.Build.Framework;
 using Microsoft.Build.Utilities;
@@ -151,9 +152,53 @@ namespace Microsoft.Build.Tasks {
 		[MonoTODO]
 		protected override bool ValidateParameters ()
 		{
-			throw new NotImplementedException ();
+			return true;
 		}
-		
+
+		protected override void LogEventsFromTextOutput (string singleLine, MessageImportance importance)
+		{
+			singleLine = singleLine.Trim ();
+			if (singleLine.Length == 0)
+				return;
+
+			// When IncludeDebugInformation is true, prevents the debug symbols stats from braeking this.
+			if (singleLine.StartsWith ("WROTE SYMFILE") ||
+				singleLine.StartsWith ("OffsetTable") ||
+				singleLine.StartsWith ("Compilation succeeded") ||
+				singleLine.StartsWith ("Compilation failed"))
+				return;
+
+			Match match = ErrorRegex.Match (singleLine);
+			if (!match.Success) {
+				Log.LogMessage (importance, singleLine);
+				return;
+			}
+
+			string filename = match.Result ("${file}") ?? "";
+
+			string line = match.Result ("${line}");
+			int lineNumber = !string.IsNullOrEmpty (line) ? Int32.Parse (line) : 0;
+
+			string col = match.Result ("${column}");
+			int columnNumber = 0;
+			if (!string.IsNullOrEmpty (col))
+				columnNumber = col == "255+" ? -1 : Int32.Parse (col);
+
+			string category = match.Result ("${level}");
+			string code = match.Result ("${number}");
+			string text = match.Result ("${message}");
+
+			if (String.Compare (category, "warning", StringComparison.OrdinalIgnoreCase) == 0) {
+				Log.LogWarning (null, code, null, filename, lineNumber, columnNumber, -1,
+					-1, text, null);
+			} else if (String.Compare (category, "error", StringComparison.OrdinalIgnoreCase) == 0) {
+				Log.LogError (null, code, null, filename, lineNumber, columnNumber, -1,
+					-1, text, null);
+			} else {
+				Log.LogMessage (importance, singleLine);
+			}
+		}
+
 		[MonoTODO]
 		public string BaseAddress {
 			get { return (string) Bag ["BaseAddress"]; }
@@ -284,6 +329,20 @@ namespace Microsoft.Build.Tasks {
 			get { return (string) Bag ["WarningsNotAsErrors"]; }
 			set { Bag ["WarningsNotAsErrors"] = value; }
 		}
+
+		// from md's VBBindingCompilerServices.cs
+		//matches "/home/path/Default.aspx.vb (40,31) : Error VBNC30205: Expected end of statement."
+		//and "Error : VBNC99999: vbnc crashed nearby this location in the source code."
+		//and "Error : VBNC99999: Unexpected error: Object reference not set to an instance of an object"
+		static Regex errorRegex;
+		static Regex ErrorRegex {
+			get {
+				if (errorRegex == null)
+					errorRegex = new Regex (@"^\s*((?<file>.*)\s?\((?<line>\d*)(,(?<column>\d*))?\) : )?(?<level>\w+) :? ?(?<number>[^:]*): (?<message>.*)$", RegexOptions.Compiled | RegexOptions.ExplicitCapture);
+				return errorRegex;
+			}
+		}
+
 	}
 }
 
diff --git a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks_test.dll.sources b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks_test.dll.sources
index 4cbc391..0b678d1 100644
--- a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks_test.dll.sources
+++ b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks_test.dll.sources
@@ -4,7 +4,7 @@ Microsoft.Build.Tasks/AssignProjectConfigurationTest.cs
 Microsoft.Build.Tasks/AssignTargetPathTest.cs
 Microsoft.Build.Tasks/CombinePathTest.cs
 Microsoft.Build.Tasks/CopyTest.cs
-Microsoft.Build.Tasks/Consts.cs
+../../Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine/Consts.cs
 Microsoft.Build.Tasks/CreateCSharpManifestResourceNameTest.cs
 Microsoft.Build.Tasks/CreateVisualBasicManifestResourceNameTest.cs
 Microsoft.Build.Tasks/CreateItemTest.cs
diff --git a/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/AssignProjectConfigurationTest.cs b/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/AssignProjectConfigurationTest.cs
index 1458c99..3673526 100644
--- a/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/AssignProjectConfigurationTest.cs
+++ b/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/AssignProjectConfigurationTest.cs
@@ -136,7 +136,7 @@ namespace MonoTests.Microsoft.Build.Tasks
 		{
 			StringBuilder sb = new StringBuilder ();
 			sb.Append (@"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"">");
-			sb.Append ("\n<UsingTask TaskName=\"Microsoft.Build.Tasks.AssignProjectConfiguration\" AssemblyName=\"Microsoft.Build.Tasks, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a\" />\n");
+			sb.Append ("\n" + GetUsingTask ("AssignProjectConfiguration"));
 			sb.AppendFormat (@"<PropertyGroup>{0}</PropertyGroup>", CreateSolutionConfigurationProperty (guids, "Release|AnyCPU"));
 			sb.Append (CreateProjectReferencesItemGroup (project_ref_guids));
 
@@ -179,5 +179,11 @@ namespace MonoTests.Microsoft.Build.Tasks
 			sb.Append ("</ItemGroup>\n");
 			return sb.ToString ();
 		}
+		
+		string GetUsingTask (string taskName)
+		{
+			return "<UsingTask TaskName='Microsoft.Build.Tasks." + taskName + "' AssemblyFile='" + Consts.GetTasksAsmPath () + "' />";
+		}
+
 	}
 }
diff --git a/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/AssignTargetPathTest.cs b/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/AssignTargetPathTest.cs
index 0d7b99e..959c899 100755
--- a/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/AssignTargetPathTest.cs
+++ b/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/AssignTargetPathTest.cs
@@ -150,7 +150,6 @@ namespace MonoTests.Microsoft.Build.Tasks
 					<Output TaskParameter=""AssignedFiles"" ItemName=""FooPath"" />
 				</AssignTargetPath>
 			</Target>
-			<Import Project=""$(MSBuildBinPath)\Microsoft.Common.targets"" />
 		</Project>", rootFolder);
 
 			return sb.ToString();
diff --git a/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/ChangeLog b/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/ChangeLog
index 4a7e842..73c326e 100644
--- a/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/ChangeLog
+++ b/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/ChangeLog
@@ -1,3 +1,22 @@
+2010-04-06  Ankit Jain  <jankit at novell.com>
+
+	* Consts.cs: Remove.
+	* AssignProjectConfigurationTest.cs:
+	* CreateCSharpManifestResourceNameTest.cs:
+	* CreateVisualBasicManifestResourceNameTest.cs:
+	* CreateItemTest.cs:
+	* FindAppConfigFileTest.cs:
+	* RemoveDuplicatesTest.cs:
+	* TaskBatchingTest.cs:
+	* WriteLinesToFileTest.cs:
+	Set the ToolsVersion to match the profile. Use the
+	full path to the tasks assembly for UsingTasks.
+
+2010-03-04  Ankit Jain  <jankit at novell.com>
+
+	* AssignTargetPathTest.cs (CreateProjectString): Remove the
+	unnecessary import of ms.common.targets .
+
 2010-02-06  Ankit Jain  <jankit at novell.com>
 
 	* LCTest.cs: New.
diff --git a/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/Consts.cs b/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/Consts.cs
deleted file mode 100644
index 2f41a67..0000000
--- a/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/Consts.cs
+++ /dev/null
@@ -1,46 +0,0 @@
-//
-// Consts.cs
-//
-// Author:
-//   Marek Sieradzki (marek.sieradzki at gmail.com)
-//
-// (C) 2006 Marek Sieradzki
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-using System;
-using Microsoft.Build.Utilities;
-
-public static class Consts {
-
-	static bool RunningOnMono ()
-	{
-		return Type.GetType ("Mono.Runtime") != null;
-	}
-	
-	public static string BinPath {
-		get {
-			if (RunningOnMono ())
-				return "../../tools/xbuild/xbuild";
-			else
-				return ToolLocationHelper.GetPathToDotNetFramework (TargetDotNetFrameworkVersion.Version20);
-		}
-	}
-}
diff --git a/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/CreateCSharpManifestResourceNameTest.cs b/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/CreateCSharpManifestResourceNameTest.cs
index 150104c..47f2b75 100755
--- a/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/CreateCSharpManifestResourceNameTest.cs
+++ b/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/CreateCSharpManifestResourceNameTest.cs
@@ -235,9 +235,9 @@ namespace MonoTests.Microsoft.Build.Tasks
 			Project project = engine.CreateNewProject ();
 			TestMessageLogger logger = new TestMessageLogger ();
 			engine.RegisterLogger (logger);
-			Console.WriteLine (projectText);
 			project.LoadXml (projectText);
 			if (!project.Build ("1")) {
+				Console.WriteLine (projectText);
 				logger.DumpMessages ();
 				Assert.Fail ("Build failed");
 			}
@@ -283,11 +283,16 @@ namespace MonoTests.Microsoft.Build.Tasks
 				sb.AppendFormat (" RootNamespace = \"{0}\"", rootNamespace);
 			sb.Append (">\n \t\t\t<Output TaskParameter=\"ManifestResourceNames\" ItemName=\"ResourceNames\" />\n");
 			sb.Append ("\t\t</CreateCSharpManifestResourceName>\n\t</Target>\n");
-			sb.Append ("\t<UsingTask TaskName=\"Microsoft.Build.Tasks.CreateCSharpManifestResourceName\" " +
-				"AssemblyName=\"Microsoft.Build.Tasks, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a\"/>\n");
+			sb.Append ("\t" + GetUsingTask ("CreateCSharpManifestResourceName"));
 			sb.Append ("</Project>");
 
 			return sb.ToString ();
 		}
+		
+		string GetUsingTask (string taskName)
+		{
+			return "<UsingTask TaskName='Microsoft.Build.Tasks." + taskName + "' AssemblyFile='" + Consts.GetTasksAsmPath () + "' />";
+		}
+
 	}
 }
diff --git a/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/CreateItemTest.cs b/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/CreateItemTest.cs
index d16c545..cfe9011 100644
--- a/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/CreateItemTest.cs
+++ b/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/CreateItemTest.cs
@@ -252,6 +252,7 @@ namespace MonoTests.Microsoft.Build.Tasks {
 
 		}
 
+#if NET_3_5 || NET_4_0
 		[Test]
 		public void TestItemsWithWildcards () {
 			Engine engine = new Engine (Consts.BinPath);
@@ -274,7 +275,7 @@ namespace MonoTests.Microsoft.Build.Tasks {
 							  };
 
 			string documentString = @"
-				<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"" ToolsVersion=""3.5"">
+				<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"" " + Consts.ToolsVersionString + @">
 					<PropertyGroup>
 						<WC>dir\**\*.dll</WC>
 						<ExWC>*\x*.dll</ExWC>
@@ -318,6 +319,7 @@ namespace MonoTests.Microsoft.Build.Tasks {
 				Directory.Delete (basedir, true);
 			}
 		}
+#endif
 
 		void CreateDirectoriesAndFiles (string basedir, string[] dirs, string[] files) {
 			foreach (string dir in dirs)
diff --git a/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/CreateVisualBasicManifestResourceNameTest.cs b/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/CreateVisualBasicManifestResourceNameTest.cs
index bb94c5c..b5b4b18 100644
--- a/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/CreateVisualBasicManifestResourceNameTest.cs
+++ b/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/CreateVisualBasicManifestResourceNameTest.cs
@@ -235,9 +235,9 @@ namespace MonoTests.Microsoft.Build.Tasks
 			Project project = engine.CreateNewProject ();
 			TestMessageLogger logger = new TestMessageLogger ();
 			engine.RegisterLogger (logger);
-			Console.WriteLine (projectText);
 			project.LoadXml (projectText);
 			if (!project.Build ("1")) {
+				Console.WriteLine (projectText);
 				logger.DumpMessages ();
 				Assert.Fail ("Build failed");
 			}
@@ -283,11 +283,16 @@ namespace MonoTests.Microsoft.Build.Tasks
 				sb.AppendFormat (" RootNamespace = \"{0}\"", rootNamespace);
 			sb.Append (">\n \t\t\t<Output TaskParameter=\"ManifestResourceNames\" ItemName=\"ResourceNames\" />\n");
 			sb.Append ("\t\t</CreateVisualBasicManifestResourceName>\n\t</Target>\n");
-			sb.Append ("\t<UsingTask TaskName=\"Microsoft.Build.Tasks.CreateVisualBasicManifestResourceName\" " +
-				"AssemblyName=\"Microsoft.Build.Tasks, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a\"/>\n");
+			sb.Append ("\t" + GetUsingTask ("CreateVisualBasicManifestResourceName"));
 			sb.Append ("</Project>");
 
 			return sb.ToString ();
 		}
+		
+		string GetUsingTask (string taskName)
+		{
+			return "<UsingTask TaskName='Microsoft.Build.Tasks." + taskName + "' AssemblyFile='" + Consts.GetTasksAsmPath () + "' />";
+		}
+
 	}
 }
diff --git a/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/FindAppConfigFileTest.cs b/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/FindAppConfigFileTest.cs
index d6b9d0a..5aaa230 100644
--- a/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/FindAppConfigFileTest.cs
+++ b/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/FindAppConfigFileTest.cs
@@ -25,6 +25,8 @@
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
+#if NET_3_5
+
 using System;
 using System.Collections;
 using Microsoft.Build.BuildEngine;
@@ -85,7 +87,7 @@ namespace MonoTests.Microsoft.Build.Tasks {
 		void CheckOutput (string[] primary_list, string[] secondary_list, string expected) {
 			StringBuilder sb = new StringBuilder ();
 
-			sb.Append (@"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"" ToolsVersion=""3.5"">");
+			sb.Append (@"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"" " + Consts.ToolsVersionString + ">");
 			sb.Append ("\t<ItemGroup>");
 			if (primary_list != null)
 				foreach (string s in primary_list)
@@ -124,4 +126,4 @@ namespace MonoTests.Microsoft.Build.Tasks {
 		}
 	}
 }	
-
+#endif
diff --git a/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/RemoveDuplicatesTest.cs b/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/RemoveDuplicatesTest.cs
index b4c17a8..6c1975c 100644
--- a/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/RemoveDuplicatesTest.cs
+++ b/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/RemoveDuplicatesTest.cs
@@ -44,7 +44,7 @@ namespace MonoTests.Microsoft.Build.Tasks
 		public void Test1 ()
 		{
 			string documentString = @"
-                                <Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"" ToolsVersion='3.5'>
+                                <Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"" " + Consts.ToolsVersionString + @">
 				
 				<ItemGroup>
 					<Items Include='A'>
diff --git a/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/TaskBatchingTest.cs b/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/TaskBatchingTest.cs
index 6bfaae7..e854812 100644
--- a/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/TaskBatchingTest.cs
+++ b/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/TaskBatchingTest.cs
@@ -40,6 +40,12 @@ namespace MonoTests.Microsoft.Build.Tasks
 	[TestFixture]
 	public class TaskBatchingTest
 	{
+		string projectHeader;
+		public TaskBatchingTest ()
+		{
+			projectHeader = @"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"" " + Consts.ToolsVersionString + ">";
+		}
+
 		[Test]
 		public void Test1 ()
 		{
@@ -548,7 +554,7 @@ namespace MonoTests.Microsoft.Build.Tasks
 		// batching should happen only on basis of the task attributes,
 		// and not the resolved expression values
 		public void TestBatching1 () {
-			string projectString = @"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"" ToolsVersion=""3.5"">
+			string projectString = projectHeader + @"
 	<ItemGroup>
 		<item3 Include=""foo""/>
 		<item2 Include=""%(item3.Identity)""/>
@@ -584,7 +590,7 @@ namespace MonoTests.Microsoft.Build.Tasks
 		// batching should happen only on basis of the task attributes,
 		// and not the resolved expression values
 		public void TestConditionalBatching2 () {
-			string projectString = @"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"" ToolsVersion=""3.5"">
+			string projectString = projectHeader + @"
 	<ItemGroup>
 		<item2 Include=""%(item3.Identity)""/>
 		<item4 Include=""%(item2.Identity);@(item3)""/>
@@ -614,7 +620,7 @@ namespace MonoTests.Microsoft.Build.Tasks
 
 		[Test]
 		public void TestBatchingWithUnbatchedItems () {
-			string projectString = @"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"" ToolsVersion=""3.5"">
+			string projectString = projectHeader + @"
 	<ItemGroup>
 		<Item1 Include=""One""/>
 		<Item1 Include=""Two""/>
@@ -651,7 +657,7 @@ namespace MonoTests.Microsoft.Build.Tasks
 
 		[Test]
 		public void TestPropertiesWithBatchedReferences () {
-			string projectString = @"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"" ToolsVersion=""3.5"">
+			string projectString = projectHeader + @"
 	<ItemGroup>
 		<Item1 Include=""One""/>
 		<Item1 Include=""Two""/>
@@ -693,7 +699,7 @@ namespace MonoTests.Microsoft.Build.Tasks
 
 		[Test]
 		public void TestPropertiesWithDynamicItems () {
-			string projectString = @"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"" ToolsVersion=""3.5"">
+			string projectString = projectHeader + @"
 	<ItemGroup>
 		<Item1 Include=""One""/>
 		<Item1 Include=""Two""/>
@@ -748,7 +754,7 @@ namespace MonoTests.Microsoft.Build.Tasks
 
 		[Test]
 		public void TestTargetInvocationFromBatchedTask () {
-			string projectString = @"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"" ToolsVersion=""3.5"">
+			string projectString = projectHeader + @"
 	<ItemGroup>
 		<Item1 Include=""One""/>
 		<Item1 Include=""Two""/>
@@ -799,7 +805,7 @@ namespace MonoTests.Microsoft.Build.Tasks
 
 		[Test]
 		public void TestTargetInvocationFromBatchedTarget () {
-			string projectString = @"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"" ToolsVersion=""3.5"">
+			string projectString = projectHeader + @"
 	<ItemGroup>
 		<Item1 Include=""One""/>
 		<Item1 Include=""Two""/>
@@ -864,7 +870,7 @@ namespace MonoTests.Microsoft.Build.Tasks
 
 		[Test]
 		public void TestBatchingWithUnqualifiedMetadataReference () {
-			string projectString = @"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"" ToolsVersion=""3.5"">
+			string projectString = projectHeader + @"
 	<ItemGroup>
 		<Item1 Include=""One""><Md>1</Md></Item1>
 		<Item1 Include=""Two""><Md>2</Md></Item1>
diff --git a/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/WriteLinesToFileTest.cs b/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/WriteLinesToFileTest.cs
index 62c03ac..82d4471 100755
--- a/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/WriteLinesToFileTest.cs
+++ b/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/WriteLinesToFileTest.cs
@@ -159,7 +159,7 @@ namespace MonoTests.Microsoft.Build.Tasks {
 			Project project;
 
 			StringBuilder sb = new StringBuilder ();
-			sb.Append (@"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"" ToolsVersion='3.5'>
+			sb.Append (@"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"" " + Consts.ToolsVersionString + @">
 	<ItemGroup>
 ");
 
diff --git a/mcs/class/Microsoft.Build.Tasks/Test/test-config-file-net-3.5 b/mcs/class/Microsoft.Build.Tasks/Test/test-config-file-net-3.5
new file mode 100644
index 0000000..7756bca
--- /dev/null
+++ b/mcs/class/Microsoft.Build.Tasks/Test/test-config-file-net-3.5
@@ -0,0 +1,15 @@
+<?xml version ="1.0"?>
+<configuration>
+    <runtime>
+        <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
+            <dependentAssembly>
+                <assemblyIdentity name="Microsoft.Build.Framework" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
+                <bindingRedirect oldVersion="0.0.0.0-99.9.9.9" newVersion="3.5.0.0"/>
+            </dependentAssembly>
+            <dependentAssembly>
+                <assemblyIdentity name="Microsoft.Build.Engine" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
+                <bindingRedirect oldVersion="0.0.0.0-99.9.9.9" newVersion="3.5.0.0"/>
+            </dependentAssembly>
+        </assemblyBinding>
+    </runtime>
+</configuration>
diff --git a/mcs/class/Microsoft.Build.Tasks/Test/test-config-file-net-4.0 b/mcs/class/Microsoft.Build.Tasks/Test/test-config-file-net-4.0
new file mode 100644
index 0000000..3c78f3b
--- /dev/null
+++ b/mcs/class/Microsoft.Build.Tasks/Test/test-config-file-net-4.0
@@ -0,0 +1,15 @@
+<?xml version ="1.0"?>
+<configuration>
+    <runtime>
+        <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
+            <dependentAssembly>
+                <assemblyIdentity name="Microsoft.Build.Framework" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
+                <bindingRedirect oldVersion="0.0.0.0-99.9.9.9" newVersion="4.0.0.0"/>
+            </dependentAssembly>
+            <dependentAssembly>
+                <assemblyIdentity name="Microsoft.Build.Engine" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
+                <bindingRedirect oldVersion="0.0.0.0-99.9.9.9" newVersion="4.0.0.0"/>
+            </dependentAssembly>
+        </assemblyBinding>
+    </runtime>
+</configuration>
diff --git a/mcs/class/Microsoft.Build.Utilities/ChangeLog b/mcs/class/Microsoft.Build.Utilities/ChangeLog
index d82c003..19ffbef 100644
--- a/mcs/class/Microsoft.Build.Utilities/ChangeLog
+++ b/mcs/class/Microsoft.Build.Utilities/ChangeLog
@@ -1,3 +1,10 @@
+2010-04-03  Ankit Jain  <jankit at novell.com>
+
+	* Makefile: Import tools/xbuild/xbuild_targets.make, which copies
+	the target and tasks file in the correct place, to allow running
+	tests with different toolsversion.
+	Use the correct target assembly name for 4.0 profile.
+
 2010-02-10  Ankit Jain  <jankit at novell.com>
 
 	* Microsoft.Build.Utilities.dll.sources: Add ProcessStringDictionary.cs
diff --git a/mcs/class/Microsoft.Build.Utilities/Makefile b/mcs/class/Microsoft.Build.Utilities/Makefile
index bbfc0a9..a600ff9 100644
--- a/mcs/class/Microsoft.Build.Utilities/Makefile
+++ b/mcs/class/Microsoft.Build.Utilities/Makefile
@@ -12,6 +12,10 @@ endif
 
 ifeq (3.5, $(FRAMEWORK_VERSION))
 LIBRARY_NAME = Microsoft.Build.Utilities.v3.5.dll
+else
+ifeq (4.0, $(FRAMEWORK_VERSION))
+LIBRARY_NAME = Microsoft.Build.Utilities.v4.0.dll
+endif
 endif
 
 LIB_MCS_FLAGS = \
@@ -21,4 +25,8 @@ LIB_MCS_FLAGS = \
 
 TEST_MCS_FLAGS = /r:Microsoft.Build.Framework.dll
 
+export TESTING_MONO=a
+XBUILD_DIR=../../tools/xbuild
+include $(XBUILD_DIR)/xbuild_targets.make
+
 include ../../build/library.make
diff --git a/mcs/class/Microsoft.Build.Utilities/Microsoft.Build.Utilities/ChangeLog b/mcs/class/Microsoft.Build.Utilities/Microsoft.Build.Utilities/ChangeLog
index d7f994b..9b48a6e 100644
--- a/mcs/class/Microsoft.Build.Utilities/Microsoft.Build.Utilities/ChangeLog
+++ b/mcs/class/Microsoft.Build.Utilities/Microsoft.Build.Utilities/ChangeLog
@@ -1,3 +1,24 @@
+2010-04-10  Ankit Jain  <jankit at novell.com>
+
+	* ReservedNameUtils.cs (GetReservedMetadata): Handle empty item.
+
+2010-04-08  Ankit Jain  <jankit at novell.com>
+
+	* ToolTask.cs: Use regex to parse output. Regex is from monodevelop.
+
+2010-04-08  Ankit Jain  <jankit at novell.com>
+
+	* ToolTask.cs (ExecuteTool): Check that the tool exists.
+
+2010-04-03  Ankit Jain  <jankit at novell.com>
+
+	* TargetDotNetFrameworkVersion.cs: Add Version40 .
+	* Task.cs (BuildEngine2): New.
+	* ToolLocationHelper.cs: Use class/lib/net_* as the path
+	for the assemblies and targets when running tests.
+	Environment variable TESTING_MONO is set for testing.
+	This allows a 4.0 xbuild to build 2.0/3.5 projects.
+
 2010-02-19  Ankit Jain  <jankit at novell.com>
 
 	* TaskItem.cs: Track api changes.
diff --git a/mcs/class/Microsoft.Build.Utilities/Microsoft.Build.Utilities/TargetDotNetFrameworkVersion.cs b/mcs/class/Microsoft.Build.Utilities/Microsoft.Build.Utilities/TargetDotNetFrameworkVersion.cs
index 451e40e..60cd2db 100644
--- a/mcs/class/Microsoft.Build.Utilities/Microsoft.Build.Utilities/TargetDotNetFrameworkVersion.cs
+++ b/mcs/class/Microsoft.Build.Utilities/Microsoft.Build.Utilities/TargetDotNetFrameworkVersion.cs
@@ -37,7 +37,12 @@ namespace Microsoft.Build.Utilities
 		Version20,
 		Version30,
 		Version35,
+#if NET_4_0
+		Version40,
+		VersionLatest = Version40
+#else
 		VersionLatest = Version35
+#endif
 	}
 }
 
diff --git a/mcs/class/Microsoft.Build.Utilities/Microsoft.Build.Utilities/Task.cs b/mcs/class/Microsoft.Build.Utilities/Microsoft.Build.Utilities/Task.cs
index 6227634..a529e1f 100644
--- a/mcs/class/Microsoft.Build.Utilities/Microsoft.Build.Utilities/Task.cs
+++ b/mcs/class/Microsoft.Build.Utilities/Microsoft.Build.Utilities/Task.cs
@@ -70,6 +70,10 @@ namespace Microsoft.Build.Utilities
 			}
 		}
 
+		public IBuildEngine2 BuildEngine2 {
+			get { return buildEngine as IBuildEngine2; }
+		}
+
 		protected string HelpKeywordPrefix {
 			get {
 				return helpKeywordPrefix;
diff --git a/mcs/class/Microsoft.Build.Utilities/Microsoft.Build.Utilities/ToolLocationHelper.cs b/mcs/class/Microsoft.Build.Utilities/Microsoft.Build.Utilities/ToolLocationHelper.cs
index 3c13207..a6c807c 100644
--- a/mcs/class/Microsoft.Build.Utilities/Microsoft.Build.Utilities/ToolLocationHelper.cs
+++ b/mcs/class/Microsoft.Build.Utilities/Microsoft.Build.Utilities/ToolLocationHelper.cs
@@ -50,13 +50,24 @@ namespace Microsoft.Build.Utilities
 			t2 = t1.Parent;
 
 			lib_mono_dir = t2.FullName;
+			if (Environment.GetEnvironmentVariable ("TESTING_MONO") != null) {
+				mono_dir = new string [] {
+					Path.Combine (lib_mono_dir, "net_1_0"),
+					Path.Combine (lib_mono_dir, "net_2_0"),
+					Path.Combine (lib_mono_dir, "net_2_0"),
+					Path.Combine (lib_mono_dir, "net_3_5"),
+					Path.Combine (lib_mono_dir, "net_4_0")
+				};	
+			} else {
+				mono_dir = new string [] {
+					Path.Combine (lib_mono_dir, "1.0"),
+					Path.Combine (lib_mono_dir, "2.0"),
+					Path.Combine (lib_mono_dir, "2.0"),
+					Path.Combine (lib_mono_dir, "3.5"),
+					Path.Combine (lib_mono_dir, "4.0")
+				};
+			}
 
-			mono_dir = new string [] {
-				Path.Combine (lib_mono_dir, "1.0"),
-				Path.Combine (lib_mono_dir, "2.0"),
-				Path.Combine (lib_mono_dir, "2.0"),
-				Path.Combine (lib_mono_dir, "3.5")
-			};
 		}
 
 		[MonoTODO]
diff --git a/mcs/class/Microsoft.Build.Utilities/Microsoft.Build.Utilities/ToolTask.cs b/mcs/class/Microsoft.Build.Utilities/Microsoft.Build.Utilities/ToolTask.cs
index 2af0265..1a9247e 100644
--- a/mcs/class/Microsoft.Build.Utilities/Microsoft.Build.Utilities/ToolTask.cs
+++ b/mcs/class/Microsoft.Build.Utilities/Microsoft.Build.Utilities/ToolTask.cs
@@ -56,8 +56,6 @@ namespace Microsoft.Build.Utilities
 		StringBuilder toolOutput;
 		bool typeLoadException;
 
-		static Regex		regex;
-		
 		protected ToolTask ()
 			: this (null, null)
 		{
@@ -81,19 +79,6 @@ namespace Microsoft.Build.Utilities
 			this.environmentOverride = new SCS.ProcessStringDictionary ();
 		}
 
-		static ToolTask ()
-		{
-			regex = new Regex (
-				@"^\s*"
-				+ @"(((?<ORIGIN>(((\d+>)?[a-zA-Z]?:[^:]*)|([^:]*))):)"
-				+ "|())"
-				+ "(?<SUBCATEGORY>(()|([^:]*? )))"
-				+ "(?<CATEGORY>(error|warning)) "
-				+ "(?<CODE>[^:]*):"
-				+ "(?<TEXT>.*)$",
-				RegexOptions.IgnoreCase);
-		}
-
 		[MonoTODO]
 		protected virtual bool CallHostObjectToExecute ()
 		{
@@ -233,80 +218,33 @@ namespace Microsoft.Build.Utilities
 				singleLine.StartsWith ("Compilation failed"))
 				return;
 
-			string filename, origin, category, code, subcategory, text;
-			int lineNumber, columnNumber, endLineNumber, endColumnNumber;
-		
-			Match m = regex.Match (singleLine);
-			origin = m.Groups [regex.GroupNumberFromName ("ORIGIN")].Value;
-			category = m.Groups [regex.GroupNumberFromName ("CATEGORY")].Value;
-			code = m.Groups [regex.GroupNumberFromName ("CODE")].Value;
-			subcategory = m.Groups [regex.GroupNumberFromName ("SUBCATEGORY")].Value;
-			text = m.Groups [regex.GroupNumberFromName ("TEXT")].Value;
-			
-			ParseOrigin (origin, out filename, out lineNumber, out columnNumber, out endLineNumber, out endColumnNumber);
-
-			if (category == "warning") {
-				Log.LogWarning (subcategory, code, null, filename, lineNumber, columnNumber, endLineNumber,
-					endColumnNumber, text, null);
-			} else if (category == "error") {
-				Log.LogError (subcategory, code, null, filename, lineNumber, columnNumber, endLineNumber,
-					endColumnNumber, text, null);
-			} else {
+			Match match = CscErrorRegex.Match (singleLine);
+			if (!match.Success) {
 				Log.LogMessage (importance, singleLine);
+				return;
 			}
-		}
-		
-		private void ParseOrigin (string origin, out string filename,
-				     out int lineNumber, out int columnNumber,
-				     out int endLineNumber, out int endColumnNumber)
-		{
-			int lParen;
-			string[] temp;
-			string[] left, right;
-			
-			if (origin.IndexOf ('(') != -1 ) {
-				lParen = origin.IndexOf ('(');
-				filename = origin.Substring (0, lParen);
-				temp = origin.Substring (lParen + 1, origin.Length - lParen - 2).Split (',');
-				if (temp.Length == 1) {
-					left = temp [0].Split ('-');
-					if (left.Length == 1) {
-						lineNumber = Int32.Parse (left [0]);
-						columnNumber = 0;
-						endLineNumber = 0;
-						endColumnNumber = 0;
-					} else if (left.Length == 2) {
-						lineNumber = Int32.Parse (left [0]);
-						columnNumber = 0;
-						endLineNumber = Int32.Parse (left [1]);
-						endColumnNumber = 0;
-					} else
-						throw new Exception ("Invalid line/column format.");
-				} else if (temp.Length == 2) {
-					right = temp [1].Split ('-');
-					lineNumber = Int32.Parse (temp [0]);
-					endLineNumber = 0;
-					if (right.Length == 1) {
-						columnNumber = Int32.Parse (right [0]);
-						endColumnNumber = 0;
-					} else if (right.Length == 2) {
-						columnNumber = Int32.Parse (right [0]);
-						endColumnNumber = Int32.Parse (right [0]);
-					} else
-						throw new Exception ("Invalid line/column format.");
-				} else if (temp.Length == 4) {
-					lineNumber = Int32.Parse (temp [0]);
-					endLineNumber = Int32.Parse (temp [2]);
-					columnNumber = Int32.Parse (temp [1]);
-					endColumnNumber = Int32.Parse (temp [3]);
-				} else
-					throw new Exception ("Invalid line/column format.");
+
+			string filename = match.Result ("${file}") ?? "";
+			string line = match.Result ("${line}");
+			int lineNumber = !string.IsNullOrEmpty (line) ? Int32.Parse (line) : 0;
+
+			string col = match.Result ("${column}");
+			int columnNumber = 0;
+			if (!string.IsNullOrEmpty (col))
+				columnNumber = col == "255+" ? -1 : Int32.Parse (col);
+
+			string category = match.Result ("${level}");
+			string code = match.Result ("${number}");
+			string text = match.Result ("${message}");
+
+			if (String.Compare (category, "warning", StringComparison.OrdinalIgnoreCase) == 0) {
+				Log.LogWarning (null, code, null, filename, lineNumber, columnNumber, -1,
+					-1, text, null);
+			} else if (String.Compare (category, "error", StringComparison.OrdinalIgnoreCase) == 0) {
+				Log.LogError (null, code, null, filename, lineNumber, columnNumber, -1,
+					-1, text, null);
 			} else {
-				filename = origin;
-				lineNumber = 0;
-				columnNumber = 0;
-				endLineNumber = 0;
-				endColumnNumber = 0;
+				Log.LogMessage (importance, singleLine);
 			}
 		}
 
@@ -447,6 +385,17 @@ namespace Microsoft.Build.Utilities
 					toolPath  = value;
 			}
 		}
+
+		// Snatched from our codedom code, with some changes to make it compatible with csc
+		// (the line+column group is optional is csc)
+		static Regex errorRegex;
+		static Regex CscErrorRegex {
+			get {
+				if (errorRegex == null)
+					errorRegex = new Regex (@"^(\s*(?<file>[^\(]+)(\((?<line>\d*)(,(?<column>\d*[\+]*))?\))?:\s+)*(?<level>\w+)\s+(?<number>.*\d):\s*(?<message>.*)", RegexOptions.Compiled | RegexOptions.ExplicitCapture);
+				return errorRegex;
+			}
+		}
 	}
 }
 
diff --git a/mcs/class/Microsoft.Build.Utilities/Mono.XBuild.Utilities/ReservedNameUtils.cs b/mcs/class/Microsoft.Build.Utilities/Mono.XBuild.Utilities/ReservedNameUtils.cs
index 49f4899..e8379f0 100644
--- a/mcs/class/Microsoft.Build.Utilities/Mono.XBuild.Utilities/ReservedNameUtils.cs
+++ b/mcs/class/Microsoft.Build.Utilities/Mono.XBuild.Utilities/ReservedNameUtils.cs
@@ -72,6 +72,9 @@ namespace Mono.XBuild.Utilities {
 		{
 			if (metadataName == null)
 				throw new ArgumentNullException ();
+
+			if (String.IsNullOrEmpty (itemSpec))
+				return String.Empty;
 		
 			switch (metadataName.ToLower ()) {
 			case "fullpath":
diff --git a/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/ChangeLog b/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/ChangeLog
index 56fda9f..6d2d21d 100644
--- a/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/ChangeLog
+++ b/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/ChangeLog
@@ -1,3 +1,61 @@
+2010-07-13  Veerapuram Varadhan  <vvaradhan at novell.com>
+
+	** Fixes #613845
+	* Tds70.cs (WriteParameterInfo): Round money values to 4 decimals.
+	
+2010-07-12  Veerapuram Varadhan  <vvaradhan at novell.com>
+	
+	** Fixes #569543
+	* Tds70.cs (ExecPrepared): Revert back to old changes.
+	* Tds80.cs (ExecPrepared): Override for Tds 8 version that optimizes 
+	network bandwidth.
+	
+2010-07-10  Veerapuram Varadhan  <vvaradhan at novell.com>
+
+	** Fixes 620860
+	* Tds70.cs (Precision): New virtual property to handle Precision values 
+	across different Tds versions.
+	(WriteParameterInfo): Use defined Precision property instead of 
+	constant value.  Also handle Ulong and long max/min values properly.
+	* Tds80.cs (Precision): Override property to provide Tds 8 precision value.
+	
+2010-07-07  Veerapuram Varadhan  <vvaradhan at novell.com>
+
+	** Fixes #609109 - DateTime part
+	* TdsComm.cs (Append[DateTime]): More fix for handling SqlServer 
+	MinValue for DateTime.
+
+2010-07-06  Veerapuram Varadhan  <vvaradhan at novell.com>
+
+	** Fixes #609109
+	* TdsComm.cs (Append[DateTime]): Handle datetime values sanely
+	that are less than epoch.
+	(Append[string]): Fix boundary checking for availability of
+	enough buffer
+
+2010-07-03  Veerapuram Varadhan  <vvaradhan at novell.com>
+
+	** Fixes #609935
+	* TdsComm.cs (Append[string]): Fix boundary calculations of bytes 
+	to be written and available free buffer.
+
+2010-06-15  Veerapuram Varadhan  <vvaradhan at novell.com>
+
+	** Fixes #613087
+	* Tds.cs (ProcessLoginAck): Fix server version being compared in 
+	the switch-case.
+	* Tds70.cs (BuildPreparedParameters, BuildProcedureCall): Set default 
+	precision to 18 as used by MS.Net when connecting to SqlServer 7.0.
+	(BuildExec, ExecRPC): Marked protected in order to be used by Tds80 
+	and henceforth.
+	* Tds80.cs (Execute): Separated from Tds70 to include Tds80 changes.
+	
+2010-04-21  Veerapuram Varadhan  <vvaradhan at novell.com>
+
+	** Fixes #595918
+	* Tds70.cs (WriteParameterInfo): Write updated decimal value according 
+	to specified scale value.
+	
 2009-08-17  Veerapuram Varadhan  <vvaradhan at novell.com>
 
 	** Fixes #381151 NRE 
diff --git a/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/Tds.cs b/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/Tds.cs
index dbee05b..9da5e92 100644
--- a/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/Tds.cs
+++ b/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/Tds.cs
@@ -1647,17 +1647,18 @@ namespace Mono.Data.Tds.Protocol
 				comm.Skip (1);
 				srvVersion = (uint)comm.GetTdsInt ();
 
+				//Console.WriteLine ("srvVersion: {0}", srvVersion);
 				switch (srvVersion) {
-				case 0x07000000: 
+				case 0x00000007: 
 					tdsVersion = TdsVersion.tds70;
 					break;
-				case 0x07010000:
+				case 0x00000107:
 					tdsVersion = TdsVersion.tds80;
 					break;
-				case 0x71000001:
+				case 0x01000071:
 					tdsVersion = TdsVersion.tds81;
 					break;
-				case 0x72090002:
+				case 0x02000972:
 					tdsVersion = TdsVersion.tds90;
 					break;
 				}
@@ -1687,6 +1688,7 @@ namespace Mono.Data.Tds.Protocol
 			}
 
 			connected = true;
+			//Console.WriteLine ("databaseProductVersion:{0}", databaseProductVersion);
 		}
 
 		protected void OnTdsErrorMessage (TdsInternalErrorMessageEventArgs e)
diff --git a/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/Tds70.cs b/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/Tds70.cs
index a7c78a0..3bba914 100644
--- a/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/Tds70.cs
+++ b/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/Tds70.cs
@@ -76,11 +76,18 @@ namespace Mono.Data.Tds.Protocol
 		protected virtual byte[] ClientVersion {
 			get { return new byte[] {0x00, 0x0, 0x0, 0x70};}
 		}
+		
+		// Default precision is 28 for a 7.0 server. Unless and 
+		// otherwise the server is started with /p option - which would be 38
+		protected virtual byte Precision {
+			get { return 28; }
+		}
+		
 		#endregion // Properties
 		
 		#region Methods
 
-		private string BuildExec (string sql)
+		protected string BuildExec (string sql)
 		{
 			string esql = sql.Replace ("'", "''"); // escape single quote
 			if (Parameters != null && Parameters.Count > 0)
@@ -118,6 +125,12 @@ namespace Mono.Data.Tds.Protocol
 			foreach (TdsMetaParameter p in Parameters) {
 				if (parms.Length > 0)
 					parms.Append (", ");
+				
+				// Set default precision according to the TdsVersion
+				// Current default is 29 for Tds80 
+				if (p.TypeName == "decimal")
+					p.Precision = (p.Precision !=0  ? p.Precision : (byte) Precision);
+										
 				parms.Append (p.Prepare ());
 				if (p.Direction == TdsParameterDirection.Output)
 					parms.Append (" output");
@@ -152,6 +165,9 @@ namespace Mono.Data.Tds.Protocol
 						else
 							select.Append (", ");
 						select.Append ("@" + parameterName);
+						
+						if (p.TypeName == "decimal")
+							p.Precision = (p.Precision !=0 ? p.Precision : (byte) Precision);
 							
 						declare.Append (String.Format ("declare {0}\n", p.Prepare ()));
 
@@ -392,10 +408,7 @@ namespace Mono.Data.Tds.Protocol
 		public override void ExecPrepared (string commandText, TdsMetaParameterCollection parameters, int timeout, bool wantResults)
 		{
 			Parameters = parameters;
-			if (Parameters != null && Parameters.Count > 0)
-				ExecRPC (TdsRpcProcId.ExecuteSql, commandText, parameters, timeout, wantResults);
-			else
-				ExecuteQuery (BuildPreparedQuery (commandText), timeout, wantResults);
+			ExecuteQuery (BuildPreparedQuery (commandText), timeout, wantResults);
 		}
 			
 		public override void ExecProc (string commandText, TdsMetaParameterCollection parameters, int timeout, bool wantResults)
@@ -442,9 +455,9 @@ namespace Mono.Data.Tds.Protocol
 			                                          param));
 		}
 		
-		private void ExecRPC (TdsRpcProcId rpcId, string sql, 
-		                      TdsMetaParameterCollection parameters, 
-		                      int timeout, bool wantResults)
+		protected void ExecRPC (TdsRpcProcId rpcId, string sql, 
+		                        TdsMetaParameterCollection parameters, 
+		                        int timeout, bool wantResults)
 		{
 			// clean up
 			InitExec ();
@@ -561,8 +574,20 @@ namespace Mono.Data.Tds.Protocol
 
 			// Precision and Scale are non-zero for only decimal/numeric
 			if ( param.TypeName == "decimal" || param.TypeName == "numeric") {
-				Comm.Append ((param.Precision !=0 ) ? param.Precision : (byte) 29);
+				Comm.Append ((param.Precision !=0 ) ? param.Precision : Precision);
 				Comm.Append (param.Scale);
+				// Convert the decimal value according to Scale
+				if (param.Value != null && param.Value != DBNull.Value &&
+				    ((decimal)param.Value) != Decimal.MaxValue && 
+				    ((decimal)param.Value) != Decimal.MinValue &&
+				    ((decimal)param.Value) != long.MaxValue &&
+				    ((decimal)param.Value) != long.MinValue &&
+				    ((decimal)param.Value) != ulong.MaxValue &&
+				    ((decimal)param.Value) != ulong.MinValue) {
+					long expo = (long)new Decimal (System.Math.Pow (10, (double)param.Scale));
+					long pVal = (long)(((decimal)param.Value) * expo);
+					param.Value = pVal;				
+				}
 			}
 
 			
@@ -606,7 +631,8 @@ namespace Mono.Data.Tds.Protocol
 			if (size > 0) {
 				switch (param.TypeName) {
 				case "money" : {
-					Decimal val = (decimal) param.Value;
+					// 4 == SqlMoney::MoneyFormat.NumberDecimalDigits
+					Decimal val = Decimal.Round ((decimal) param.Value, 4);
 					int[] arr = Decimal.GetBits (val);
 
 					if (val >= 0) {
@@ -667,14 +693,9 @@ namespace Mono.Data.Tds.Protocol
 		{
 			Parameters = parameters;
 			string sql = commandText;
-
-			if (Parameters != null && Parameters.Count > 0) {
-				ExecRPC (TdsRpcProcId.ExecuteSql, commandText, parameters, timeout, wantResults);
-			} else {
-				if (wantResults)
-					sql = BuildExec (commandText);
-				ExecuteQuery (sql, timeout, wantResults);
-			}
+			if (wantResults || (Parameters != null && Parameters.Count > 0))
+				sql = BuildExec (commandText);
+			ExecuteQuery (sql, timeout, wantResults);
 		}
 
 		private string FormatParameter (TdsMetaParameter parameter)
diff --git a/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/Tds80.cs b/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/Tds80.cs
index 8f9273c..8d03305 100644
--- a/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/Tds80.cs
+++ b/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/Tds80.cs
@@ -61,6 +61,10 @@ namespace Mono.Data.Tds.Protocol {
 		protected override byte[] ClientVersion {
 			get { return new byte[] {0x00, 0x0, 0x0, 0x71};}
 		}
+		protected override byte Precision {
+			get { return 38; }
+		}
+		
 		#endregion // Properties
 		
 		#region Methods
@@ -210,6 +214,43 @@ namespace Mono.Data.Tds.Protocol {
 			OutputParameters.Add (value);
 		}
 		
+		public override void Execute (string commandText, TdsMetaParameterCollection parameters, int timeout, bool wantResults)
+		{
+			// We are connected to a Sql 7.0 server
+			if (TdsVersion < TdsVersion.tds80) {
+				base.Execute (commandText, parameters, timeout, wantResults);
+				return;
+			}
+
+			Parameters = parameters;
+			string sql = commandText;
+
+			if (Parameters != null && Parameters.Count > 0) {
+				ExecRPC (TdsRpcProcId.ExecuteSql, commandText, parameters, timeout, wantResults);
+			} else {
+				if (wantResults)
+					sql = BuildExec (commandText);
+				ExecuteQuery (sql, timeout, wantResults);
+			}
+		}
+		
+		public override void ExecPrepared (string commandText, TdsMetaParameterCollection parameters, int timeout, bool wantResults)
+		{
+			Parameters = parameters;
+			// We are connected to a Sql 7.0 server
+			if (TdsVersion < TdsVersion.tds80 || 
+			    Parameters == null || Parameters.Count < 1) {
+				base.ExecPrepared (commandText, parameters, timeout, wantResults);
+				return;
+			}
+			TdsMetaParameterCollection parms = new TdsMetaParameterCollection ();
+			parms.Add (new TdsMetaParameter ("@Handle", "int", Int32.Parse (commandText)));
+			foreach (TdsMetaParameter parm in Parameters)
+				parms.Add (parm);
+			
+			ExecRPC ("sp_execute", parms, timeout, wantResults);			
+		}
+
 		#endregion // Methods
 	}
 }
diff --git a/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/TdsComm.cs b/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/TdsComm.cs
index 65e362e..12c74dc 100644
--- a/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/TdsComm.cs
+++ b/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/TdsComm.cs
@@ -266,13 +266,30 @@ namespace Mono.Data.Tds.Protocol {
 		{
 			DateTime epoch = new DateTime (1900,1,1);
 			
-			TimeSpan span = t - epoch;
-			int days = span.Days ;
-			int val = 0;	
-
+			TimeSpan span = t - epoch; 
+			int days, hours, minutes, secs;
+			long msecs;
+			int val = 0;    
+ 
+			days = span.Days;
+			hours = span.Hours;
+			minutes = span.Minutes;
+			secs = span.Seconds;
+			msecs = span.Milliseconds;
+			
+			if (epoch > t) {
+				// If t.Hour is > 0, days points to the next day and hence, 
+				// we move it back by a day - otherwise, no change
+				days = (t.Hour > 0 || t.Minute > 0 || t.Second > 0 || t.Millisecond > 0) ? days-1: days;
+				hours = t.Hour;
+				minutes = t.Minute;
+				secs = t.Second;
+				msecs = t.Millisecond;
+			}
+			
 			SendIfFull (bytes);
 			if (bytes == 8) {
-				long ms = (span.Hours * 3600 + span.Minutes * 60 + span.Seconds)*1000L + (long)span.Milliseconds;
+			       long ms = (hours * 3600 + minutes * 60 + secs)*1000L + (long)msecs;			
 				val = (int) ((ms*300)/1000);
 				AppendInternal ((int) days);
 				AppendInternal ((int) val);
@@ -374,23 +391,28 @@ namespace Mono.Data.Tds.Protocol {
 			if (tdsVersion < TdsVersion.tds70) { 
 				Append (encoder.GetBytes (s));
 			} else {
-				int lenToWrite = s.Length * 2;
-				int count = lenToWrite/outBufferLength;
 				int cindex = 0, index;
-				int remBufLen = 0;
+				int ssize = sizeof (short);
+				int lenToWrite = s.Length * ssize;
+				// if nextOutBufferLength points to the last buffer in outBuffer, 
+				// we would get a DivisionByZero while calculating remBufLen
+				if (outBufferLength - nextOutBufferIndex < ssize)
+					SendIfFull (ssize);
+				
+				int remBufLen = outBufferLength - nextOutBufferIndex;
+				int count = lenToWrite/remBufLen;
 				
-				if (lenToWrite % outBufferLength > 0)
+				if (lenToWrite % remBufLen > 0)
 					count++;
 			
-				remBufLen = outBufferLength - nextOutBufferIndex;
 				for (int i = 0; i < count; i++) {
-					index = System.Math.Min (remBufLen, lenToWrite);
-					for (int j = 0; j < index; j+=2, cindex++)
+					index = System.Math.Min (remBufLen/ssize, lenToWrite/ssize);
+					for (int j = 0; j < index*ssize; j+=2, cindex++)
 						AppendInternal ((short)s[cindex]);
 					
-					lenToWrite -= System.Math.Min (remBufLen, lenToWrite);
+					lenToWrite -= index*ssize;
 					// Just make sure to flush the buffer
-					SendIfFull (lenToWrite+2);
+					SendIfFull ((lenToWrite+1)*ssize);
 				}
 			}
 		}	
diff --git a/mcs/class/Mono.Data.Tds/Mono.Data.Tds/ChangeLog b/mcs/class/Mono.Data.Tds/Mono.Data.Tds/ChangeLog
index f023697..f61f136 100644
--- a/mcs/class/Mono.Data.Tds/Mono.Data.Tds/ChangeLog
+++ b/mcs/class/Mono.Data.Tds/Mono.Data.Tds/ChangeLog
@@ -1,3 +1,14 @@
+2010-07-06  Veerapuram Varadhan  <vvaradhan at novell.com>
+	
+	* TdsMetaParameter.cs (Prepare): Use the count of characters in nvarchar 
+	param as the size, to match .NET implementation.
+       
+2010-07-03  Veerapuram Varadhan  <vvaradhan at novell.com>
+
+	** Fixes #609935
+	* TdsMetaParameter.cs (Prepare): Use GetActualSize() instead of Size 
+	property to calculate the length of a nvarchar param.
+	
 2009-05-26  Veerapuram Varadhan  <vvaradhan at novell.com>
 
 	* TdsComm.cs (Append):  When appending strings of length bigger than 
diff --git a/mcs/class/Mono.Data.Tds/Mono.Data.Tds/TdsMetaParameter.cs b/mcs/class/Mono.Data.Tds/Mono.Data.Tds/TdsMetaParameter.cs
index 2c89dfe..931afea 100644
--- a/mcs/class/Mono.Data.Tds/Mono.Data.Tds/TdsMetaParameter.cs
+++ b/mcs/class/Mono.Data.Tds/Mono.Data.Tds/TdsMetaParameter.cs
@@ -231,7 +231,7 @@ namespace Mono.Data.Tds {
 			case "numeric":
 				// msdotnet sends a default precision of 29
 				result.Append (String.Format ("({0},{1})",
-					 (Precision == (byte)0 ? (byte)29 : Precision), Scale));
+					 (Precision == (byte)0 ? (byte)38 : Precision), Scale));
 				break;
 			case "varchar":
 			case "varbinary":
@@ -246,7 +246,8 @@ namespace Mono.Data.Tds {
 				break;
 			case "nvarchar":
 			case "xml":
-				result.Append (Size > 0 ? (Size > 8000 ? "(max)" : String.Format ("({0})", Size)) : "(4000)");
+				int paramSize = GetActualSize () / 2;
+				result.Append (paramSize > 0 ? (paramSize > 4000 ? "(max)" : String.Format ("({0})", paramSize)) : "(4000)");
 				break;
 			case "char":
 			case "nchar":
diff --git a/mcs/class/Mono.Debugger.Soft/ChangeLog b/mcs/class/Mono.Debugger.Soft/ChangeLog
index 26d2fb3..d539839 100644
--- a/mcs/class/Mono.Debugger.Soft/ChangeLog
+++ b/mcs/class/Mono.Debugger.Soft/ChangeLog
@@ -1,3 +1,7 @@
+2010-06-15  Zoltan Varga  <vargaz at gmail.com>
+
+	* *: Add testing infrastructure by moving the tests from mono/tests.
+
 2009-11-03  Zoltan Varga  <vargaz at gmail.com>
 
 	* Makefile: Don't define LIBRARY_PACKAGE so it gets installed normally.
diff --git a/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/AppDomainMirror.xml b/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/AppDomainMirror.xml
new file mode 100644
index 0000000..069f94f
--- /dev/null
+++ b/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/AppDomainMirror.xml
@@ -0,0 +1,98 @@
+<Type Name="AppDomainMirror" FullName="Mono.Debugger.Soft.AppDomainMirror">
+  <TypeSignature Language="C#" Value="public class AppDomainMirror : Mono.Debugger.Soft.Mirror" />
+  <AssemblyInfo>
+    <AssemblyName>Mono.Debugger.Soft</AssemblyName>
+    <AssemblyVersion>0.0.0.0</AssemblyVersion>
+  </AssemblyInfo>
+  <Base>
+    <BaseTypeName>Mono.Debugger.Soft.Mirror</BaseTypeName>
+  </Base>
+  <Interfaces />
+  <Docs>
+    <summary>Represents an AppDomain in the debuggee.</summary>
+    <remarks>To be added.</remarks>
+  </Docs>
+  <Members>
+    <Member MemberName="Corlib">
+      <MemberSignature Language="C#" Value="public Mono.Debugger.Soft.AssemblyMirror Corlib { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.AssemblyMirror</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="CreateString">
+      <MemberSignature Language="C#" Value="public Mono.Debugger.Soft.StringMirror CreateString (string s);" />
+      <MemberType>Method</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.StringMirror</ReturnType>
+      </ReturnValue>
+      <Parameters>
+        <Parameter Name="s" Type="System.String" />
+      </Parameters>
+      <Docs>
+        <param name="s">To be added.</param>
+        <summary>To be added.</summary>
+        <returns>To be added.</returns>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="FriendlyName">
+      <MemberSignature Language="C#" Value="public string FriendlyName { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.String</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="GetAssemblies">
+      <MemberSignature Language="C#" Value="public Mono.Debugger.Soft.AssemblyMirror[] GetAssemblies ();" />
+      <MemberType>Method</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.AssemblyMirror[]</ReturnType>
+      </ReturnValue>
+      <Parameters />
+      <Docs>
+        <summary>To be added.</summary>
+        <returns>To be added.</returns>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="GetEntryAssembly">
+      <MemberSignature Language="C#" Value="public Mono.Debugger.Soft.AssemblyMirror GetEntryAssembly ();" />
+      <MemberType>Method</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.AssemblyMirror</ReturnType>
+      </ReturnValue>
+      <Parameters />
+      <Docs>
+        <summary>To be added.</summary>
+        <returns>To be added.</returns>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+  </Members>
+</Type>
diff --git a/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/ArrayMirror.xml b/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/ArrayMirror.xml
new file mode 100644
index 0000000..4a903b1
--- /dev/null
+++ b/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/ArrayMirror.xml
@@ -0,0 +1,208 @@
+<Type Name="ArrayMirror" FullName="Mono.Debugger.Soft.ArrayMirror">
+  <TypeSignature Language="C#" Value="public class ArrayMirror : Mono.Debugger.Soft.ObjectMirror, System.Collections.IEnumerable" />
+  <AssemblyInfo>
+    <AssemblyName>Mono.Debugger.Soft</AssemblyName>
+    <AssemblyVersion>0.0.0.0</AssemblyVersion>
+  </AssemblyInfo>
+  <Base>
+    <BaseTypeName>Mono.Debugger.Soft.ObjectMirror</BaseTypeName>
+  </Base>
+  <Interfaces>
+    <Interface>
+      <InterfaceName>System.Collections.IEnumerable</InterfaceName>
+    </Interface>
+  </Interfaces>
+  <Docs>
+    <summary>Represents an array object in the debuggee.</summary>
+    <remarks>
+    </remarks>
+  </Docs>
+  <Members>
+    <Member MemberName="GetLength">
+      <MemberSignature Language="C#" Value="public int GetLength (int dimension);" />
+      <MemberType>Method</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Int32</ReturnType>
+      </ReturnValue>
+      <Parameters>
+        <Parameter Name="dimension" Type="System.Int32" />
+      </Parameters>
+      <Docs>
+        <param name="dimension">To be added.</param>
+        <summary>To be added.</summary>
+        <returns>To be added.</returns>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="GetLowerBound">
+      <MemberSignature Language="C#" Value="public int GetLowerBound (int dimension);" />
+      <MemberType>Method</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Int32</ReturnType>
+      </ReturnValue>
+      <Parameters>
+        <Parameter Name="dimension" Type="System.Int32" />
+      </Parameters>
+      <Docs>
+        <param name="dimension">To be added.</param>
+        <summary>To be added.</summary>
+        <returns>To be added.</returns>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="GetValues">
+      <MemberSignature Language="C#" Value="public System.Collections.Generic.IList<Mono.Debugger.Soft.Value> GetValues (int index, int length);" />
+      <MemberType>Method</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Collections.Generic.IList<Mono.Debugger.Soft.Value></ReturnType>
+      </ReturnValue>
+      <Parameters>
+        <Parameter Name="index" Type="System.Int32" />
+        <Parameter Name="length" Type="System.Int32" />
+      </Parameters>
+      <Docs>
+        <param name="index">To be added.</param>
+        <param name="length">To be added.</param>
+        <summary>To be added.</summary>
+        <returns>To be added.</returns>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="Item">
+      <MemberSignature Language="C#" Value="public Mono.Debugger.Soft.Value this[int index] { set; get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.Value</ReturnType>
+      </ReturnValue>
+      <Parameters>
+        <Parameter Name="index" Type="System.Int32" />
+      </Parameters>
+      <Docs>
+        <param name="index">To be added.</param>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="Length">
+      <MemberSignature Language="C#" Value="public int Length { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Int32</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="lengths">
+      <MemberSignature Language="C#" Value="public int[] lengths;" />
+      <MemberType>Field</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Int32[]</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="lower_bounds">
+      <MemberSignature Language="C#" Value="public int[] lower_bounds;" />
+      <MemberType>Field</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Int32[]</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="rank">
+      <MemberSignature Language="C#" Value="public int rank;" />
+      <MemberType>Field</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Int32</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="Rank">
+      <MemberSignature Language="C#" Value="public int Rank { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Int32</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="SetValues">
+      <MemberSignature Language="C#" Value="public void SetValues (int index, Mono.Debugger.Soft.Value[] values);" />
+      <MemberType>Method</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Void</ReturnType>
+      </ReturnValue>
+      <Parameters>
+        <Parameter Name="index" Type="System.Int32" />
+        <Parameter Name="values" Type="Mono.Debugger.Soft.Value[]" />
+      </Parameters>
+      <Docs>
+        <param name="index">To be added.</param>
+        <param name="values">To be added.</param>
+        <summary>To be added.</summary>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="System.Collections.IEnumerable.GetEnumerator">
+      <MemberSignature Language="C#" Value="System.Collections.IEnumerator IEnumerable.GetEnumerator ();" />
+      <MemberType>Method</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Collections.IEnumerator</ReturnType>
+      </ReturnValue>
+      <Parameters />
+      <Docs>
+        <summary>To be added.</summary>
+        <returns>To be added.</returns>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+  </Members>
+</Type>
diff --git a/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/AssemblyLoadEvent.xml b/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/AssemblyLoadEvent.xml
new file mode 100644
index 0000000..9545264
--- /dev/null
+++ b/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/AssemblyLoadEvent.xml
@@ -0,0 +1,33 @@
+<Type Name="AssemblyLoadEvent" FullName="Mono.Debugger.Soft.AssemblyLoadEvent">
+  <TypeSignature Language="C#" Value="public class AssemblyLoadEvent : Mono.Debugger.Soft.Event" />
+  <AssemblyInfo>
+    <AssemblyName>Mono.Debugger.Soft</AssemblyName>
+    <AssemblyVersion>0.0.0.0</AssemblyVersion>
+  </AssemblyInfo>
+  <Base>
+    <BaseTypeName>Mono.Debugger.Soft.Event</BaseTypeName>
+  </Base>
+  <Interfaces />
+  <Docs>
+    <summary>Sent when an AssemblyLoad event occurs in the debuggee.</summary>
+    <remarks>
+    </remarks>
+  </Docs>
+  <Members>
+    <Member MemberName="Assembly">
+      <MemberSignature Language="C#" Value="public Mono.Debugger.Soft.AssemblyMirror Assembly { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.AssemblyMirror</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+  </Members>
+</Type>
diff --git a/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/AssemblyMirror.xml b/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/AssemblyMirror.xml
new file mode 100644
index 0000000..439aa9b
--- /dev/null
+++ b/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/AssemblyMirror.xml
@@ -0,0 +1,117 @@
+<Type Name="AssemblyMirror" FullName="Mono.Debugger.Soft.AssemblyMirror">
+  <TypeSignature Language="C#" Value="public class AssemblyMirror : Mono.Debugger.Soft.Mirror" />
+  <AssemblyInfo>
+    <AssemblyName>Mono.Debugger.Soft</AssemblyName>
+    <AssemblyVersion>0.0.0.0</AssemblyVersion>
+  </AssemblyInfo>
+  <Base>
+    <BaseTypeName>Mono.Debugger.Soft.Mirror</BaseTypeName>
+  </Base>
+  <Interfaces />
+  <Docs>
+    <summary>Represents an Assembly in the debuggee.</summary>
+    <remarks>
+    </remarks>
+  </Docs>
+  <Members>
+    <Member MemberName="EntryPoint">
+      <MemberSignature Language="C#" Value="public Mono.Debugger.Soft.MethodMirror EntryPoint { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.MethodMirror</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="GetAssemblyObject">
+      <MemberSignature Language="C#" Value="public Mono.Debugger.Soft.ObjectMirror GetAssemblyObject ();" />
+      <MemberType>Method</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.ObjectMirror</ReturnType>
+      </ReturnValue>
+      <Parameters />
+      <Docs>
+        <summary>To be added.</summary>
+        <returns>To be added.</returns>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="GetType">
+      <MemberSignature Language="C#" Value="public Mono.Debugger.Soft.TypeMirror GetType (string name, bool throwOnError, bool ignoreCase);" />
+      <MemberType>Method</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.TypeMirror</ReturnType>
+      </ReturnValue>
+      <Parameters>
+        <Parameter Name="name" Type="System.String" />
+        <Parameter Name="throwOnError" Type="System.Boolean" />
+        <Parameter Name="ignoreCase" Type="System.Boolean" />
+      </Parameters>
+      <Docs>
+        <param name="name">To be added.</param>
+        <param name="throwOnError">To be added.</param>
+        <param name="ignoreCase">To be added.</param>
+        <summary>To be added.</summary>
+        <returns>To be added.</returns>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="Location">
+      <MemberSignature Language="C#" Value="public string Location { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.String</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="ManifestModule">
+      <MemberSignature Language="C#" Value="public Mono.Debugger.Soft.ModuleMirror ManifestModule { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.ModuleMirror</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="Metadata">
+      <MemberSignature Language="C#" Value="public Mono.Cecil.AssemblyDefinition Metadata { set; get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Cecil.AssemblyDefinition</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+  </Members>
+</Type>
diff --git a/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/BreakpointEvent.xml b/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/BreakpointEvent.xml
new file mode 100644
index 0000000..a427cb9
--- /dev/null
+++ b/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/BreakpointEvent.xml
@@ -0,0 +1,33 @@
+<Type Name="BreakpointEvent" FullName="Mono.Debugger.Soft.BreakpointEvent">
+  <TypeSignature Language="C#" Value="public class BreakpointEvent : Mono.Debugger.Soft.Event" />
+  <AssemblyInfo>
+    <AssemblyName>Mono.Debugger.Soft</AssemblyName>
+    <AssemblyVersion>0.0.0.0</AssemblyVersion>
+  </AssemblyInfo>
+  <Base>
+    <BaseTypeName>Mono.Debugger.Soft.Event</BaseTypeName>
+  </Base>
+  <Interfaces />
+  <Docs>
+    <summary>Sent when a Breakpoint event occurs in the debuggee.</summary>
+    <remarks>
+    </remarks>
+  </Docs>
+  <Members>
+    <Member MemberName="Method">
+      <MemberSignature Language="C#" Value="public Mono.Debugger.Soft.MethodMirror Method { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.MethodMirror</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+  </Members>
+</Type>
diff --git a/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/BreakpointEventRequest.xml b/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/BreakpointEventRequest.xml
new file mode 100644
index 0000000..46410b6
--- /dev/null
+++ b/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/BreakpointEventRequest.xml
@@ -0,0 +1,32 @@
+<Type Name="BreakpointEventRequest" FullName="Mono.Debugger.Soft.BreakpointEventRequest">
+  <TypeSignature Language="C#" Value="public sealed class BreakpointEventRequest : Mono.Debugger.Soft.EventRequest" />
+  <AssemblyInfo>
+    <AssemblyName>Mono.Debugger.Soft</AssemblyName>
+    <AssemblyVersion>0.0.0.0</AssemblyVersion>
+  </AssemblyInfo>
+  <Base>
+    <BaseTypeName>Mono.Debugger.Soft.EventRequest</BaseTypeName>
+  </Base>
+  <Interfaces />
+  <Docs>
+    <summary>Request for Breakpoint events.</summary>
+    <remarks>To be added.</remarks>
+  </Docs>
+  <Members>
+    <Member MemberName="Enable">
+      <MemberSignature Language="C#" Value="public override void Enable ();" />
+      <MemberType>Method</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Void</ReturnType>
+      </ReturnValue>
+      <Parameters />
+      <Docs>
+        <summary>To be added.</summary>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+  </Members>
+</Type>
diff --git a/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/CustomAttributeDataMirror.xml b/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/CustomAttributeDataMirror.xml
new file mode 100644
index 0000000..c5c7948
--- /dev/null
+++ b/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/CustomAttributeDataMirror.xml
@@ -0,0 +1,88 @@
+<Type Name="CustomAttributeDataMirror" FullName="Mono.Debugger.Soft.CustomAttributeDataMirror">
+  <TypeSignature Language="C#" Value="public sealed class CustomAttributeDataMirror" />
+  <AssemblyInfo>
+    <AssemblyName>Mono.Debugger.Soft</AssemblyName>
+    <AssemblyVersion>0.0.0.0</AssemblyVersion>
+  </AssemblyInfo>
+  <Base>
+    <BaseTypeName>System.Object</BaseTypeName>
+  </Base>
+  <Interfaces />
+  <Docs>
+    <summary>Represents a custom attribute in the debuggee.</summary>
+    <remarks>To avoid interfering with the execution of the debuggee, the GetCustomAttribute () methods don't create the custom attributes directly, instead they return CustomAttributeDataMirror objects which are similar to the CustomAttributeData objects used in the reflection-only functionality of .net.</remarks>
+  </Docs>
+  <Members>
+    <Member MemberName="Constructor">
+      <MemberSignature Language="C#" Value="public Mono.Debugger.Soft.MethodMirror Constructor { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <Attributes>
+        <Attribute>
+          <AttributeName>System.Runtime.InteropServices.ComVisible(true)</AttributeName>
+        </Attribute>
+      </Attributes>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.MethodMirror</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>The constructor which creates this custom attribute.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="ConstructorArguments">
+      <MemberSignature Language="C#" Value="public System.Collections.Generic.IList<Mono.Debugger.Soft.CustomAttributeTypedArgumentMirror> ConstructorArguments { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <Attributes>
+        <Attribute>
+          <AttributeName>System.Runtime.InteropServices.ComVisible(true)</AttributeName>
+        </Attribute>
+      </Attributes>
+      <ReturnValue>
+        <ReturnType>System.Collections.Generic.IList<Mono.Debugger.Soft.CustomAttributeTypedArgumentMirror></ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>The arguments to the constructor.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="NamedArguments">
+      <MemberSignature Language="C#" Value="public System.Collections.Generic.IList<Mono.Debugger.Soft.CustomAttributeNamedArgumentMirror> NamedArguments { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Collections.Generic.IList<Mono.Debugger.Soft.CustomAttributeNamedArgumentMirror></ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>Additional arguments of the custom attribute</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="ToString">
+      <MemberSignature Language="C#" Value="public override string ToString ();" />
+      <MemberType>Method</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.String</ReturnType>
+      </ReturnValue>
+      <Parameters />
+      <Docs>
+        <summary>To be added.</summary>
+        <returns>To be added.</returns>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+  </Members>
+</Type>
diff --git a/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/CustomAttributeNamedArgumentMirror.xml b/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/CustomAttributeNamedArgumentMirror.xml
new file mode 100644
index 0000000..de945e9
--- /dev/null
+++ b/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/CustomAttributeNamedArgumentMirror.xml
@@ -0,0 +1,62 @@
+<Type Name="CustomAttributeNamedArgumentMirror" FullName="Mono.Debugger.Soft.CustomAttributeNamedArgumentMirror">
+  <TypeSignature Language="C#" Value="public struct CustomAttributeNamedArgumentMirror" />
+  <AssemblyInfo>
+    <AssemblyName>Mono.Debugger.Soft</AssemblyName>
+    <AssemblyVersion>0.0.0.0</AssemblyVersion>
+  </AssemblyInfo>
+  <Base>
+    <BaseTypeName>System.ValueType</BaseTypeName>
+  </Base>
+  <Interfaces />
+  <Docs>
+    <summary>To be added.</summary>
+    <remarks>To be added.</remarks>
+  </Docs>
+  <Members>
+    <Member MemberName="Field">
+      <MemberSignature Language="C#" Value="public Mono.Debugger.Soft.FieldInfoMirror Field { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.FieldInfoMirror</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="Property">
+      <MemberSignature Language="C#" Value="public Mono.Debugger.Soft.PropertyInfoMirror Property { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.PropertyInfoMirror</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="TypedValue">
+      <MemberSignature Language="C#" Value="public Mono.Debugger.Soft.CustomAttributeTypedArgumentMirror TypedValue { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.CustomAttributeTypedArgumentMirror</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+  </Members>
+</Type>
diff --git a/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/CustomAttributeTypedArgumentMirror.xml b/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/CustomAttributeTypedArgumentMirror.xml
new file mode 100644
index 0000000..55270f0
--- /dev/null
+++ b/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/CustomAttributeTypedArgumentMirror.xml
@@ -0,0 +1,63 @@
+<Type Name="CustomAttributeTypedArgumentMirror" FullName="Mono.Debugger.Soft.CustomAttributeTypedArgumentMirror">
+  <TypeSignature Language="C#" Value="public struct CustomAttributeTypedArgumentMirror" />
+  <AssemblyInfo>
+    <AssemblyName>Mono.Debugger.Soft</AssemblyName>
+    <AssemblyVersion>0.0.0.0</AssemblyVersion>
+  </AssemblyInfo>
+  <Base>
+    <BaseTypeName>System.ValueType</BaseTypeName>
+  </Base>
+  <Interfaces />
+  <Docs>
+    <summary>To be added.</summary>
+    <remarks>To be added.</remarks>
+  </Docs>
+  <Members>
+    <Member MemberName="ArgumentType">
+      <MemberSignature Language="C#" Value="public Type ArgumentType { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Type</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="ToString">
+      <MemberSignature Language="C#" Value="public override string ToString ();" />
+      <MemberType>Method</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.String</ReturnType>
+      </ReturnValue>
+      <Parameters />
+      <Docs>
+        <summary>To be added.</summary>
+        <returns>To be added.</returns>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="Value">
+      <MemberSignature Language="C#" Value="public object Value { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Object</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>This property returns a normal object, not a Value object. This is possible because custom attribute arguments can only have a limited set of types. So for example, in [Attr (Name="A", Type=typeof (int))], the value of 'Name' will be a String, not a StringMirror, and the value of 'Type' will be a TypeMirror, not an ObjectMirror.</remarks>
+      </Docs>
+    </Member>
+  </Members>
+</Type>
diff --git a/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/EnumMirror.xml b/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/EnumMirror.xml
new file mode 100644
index 0000000..008935f
--- /dev/null
+++ b/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/EnumMirror.xml
@@ -0,0 +1,48 @@
+<Type Name="EnumMirror" FullName="Mono.Debugger.Soft.EnumMirror">
+  <TypeSignature Language="C#" Value="public class EnumMirror : Mono.Debugger.Soft.StructMirror" />
+  <AssemblyInfo>
+    <AssemblyName>Mono.Debugger.Soft</AssemblyName>
+    <AssemblyVersion>0.0.0.0</AssemblyVersion>
+  </AssemblyInfo>
+  <Base>
+    <BaseTypeName>Mono.Debugger.Soft.StructMirror</BaseTypeName>
+  </Base>
+  <Interfaces />
+  <Docs>
+    <summary>Represents an enum instance in the debuggee.</summary>
+    <remarks>
+    </remarks>
+  </Docs>
+  <Members>
+    <Member MemberName="StringValue">
+      <MemberSignature Language="C#" Value="public string StringValue { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.String</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="Value">
+      <MemberSignature Language="C#" Value="public object Value { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Object</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+  </Members>
+</Type>
diff --git a/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/ErrorCode.xml b/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/ErrorCode.xml
new file mode 100644
index 0000000..e71dc98
--- /dev/null
+++ b/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/ErrorCode.xml
@@ -0,0 +1,108 @@
+<Type Name="ErrorCode" FullName="Mono.Debugger.Soft.ErrorCode">
+  <TypeSignature Language="C#" Value="public enum ErrorCode" />
+  <AssemblyInfo>
+    <AssemblyName>Mono.Debugger.Soft</AssemblyName>
+    <AssemblyVersion>0.0.0.0</AssemblyVersion>
+  </AssemblyInfo>
+  <Base>
+    <BaseTypeName>System.Enum</BaseTypeName>
+  </Base>
+  <Docs>
+    <summary>Error codes sent by debuggee using the wire protocol.</summary>
+    <remarks>
+    </remarks>
+  </Docs>
+  <Members>
+    <Member MemberName="INVALID_ARGUMENT">
+      <MemberSignature Language="C#" Value="INVALID_ARGUMENT" />
+      <MemberType>Field</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.ErrorCode</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+      </Docs>
+    </Member>
+    <Member MemberName="INVALID_FIELDID">
+      <MemberSignature Language="C#" Value="INVALID_FIELDID" />
+      <MemberType>Field</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.ErrorCode</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+      </Docs>
+    </Member>
+    <Member MemberName="INVALID_FRAMEID">
+      <MemberSignature Language="C#" Value="INVALID_FRAMEID" />
+      <MemberType>Field</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.ErrorCode</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+      </Docs>
+    </Member>
+    <Member MemberName="INVALID_OBJECT">
+      <MemberSignature Language="C#" Value="INVALID_OBJECT" />
+      <MemberType>Field</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.ErrorCode</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+      </Docs>
+    </Member>
+    <Member MemberName="NONE">
+      <MemberSignature Language="C#" Value="NONE" />
+      <MemberType>Field</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.ErrorCode</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+      </Docs>
+    </Member>
+    <Member MemberName="NOT_IMPLEMENTED">
+      <MemberSignature Language="C#" Value="NOT_IMPLEMENTED" />
+      <MemberType>Field</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.ErrorCode</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+      </Docs>
+    </Member>
+    <Member MemberName="NOT_SUSPENDED">
+      <MemberSignature Language="C#" Value="NOT_SUSPENDED" />
+      <MemberType>Field</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.ErrorCode</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+      </Docs>
+    </Member>
+  </Members>
+</Type>
diff --git a/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/ErrorHandlerEventArgs.xml b/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/ErrorHandlerEventArgs.xml
new file mode 100644
index 0000000..9386c27
--- /dev/null
+++ b/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/ErrorHandlerEventArgs.xml
@@ -0,0 +1,45 @@
+<Type Name="ErrorHandlerEventArgs" FullName="Mono.Debugger.Soft.ErrorHandlerEventArgs">
+  <TypeSignature Language="C#" Value="public class ErrorHandlerEventArgs : EventArgs" />
+  <AssemblyInfo>
+    <AssemblyName>Mono.Debugger.Soft</AssemblyName>
+    <AssemblyVersion>0.0.0.0</AssemblyVersion>
+  </AssemblyInfo>
+  <Base>
+    <BaseTypeName>System.EventArgs</BaseTypeName>
+  </Base>
+  <Interfaces />
+  <Docs>
+    <summary>Arguments to the Connection event handler.</summary>
+    <remarks>
+    </remarks>
+  </Docs>
+  <Members>
+    <Member MemberName=".ctor">
+      <MemberSignature Language="C#" Value="public ErrorHandlerEventArgs ();" />
+      <MemberType>Constructor</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <Parameters />
+      <Docs>
+        <summary>To be added.</summary>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="ErrorCode">
+      <MemberSignature Language="C#" Value="public Mono.Debugger.Soft.ErrorCode ErrorCode { set; get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.ErrorCode</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+  </Members>
+</Type>
diff --git a/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/Event.xml b/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/Event.xml
new file mode 100644
index 0000000..efdbdc8
--- /dev/null
+++ b/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/Event.xml
@@ -0,0 +1,96 @@
+<Type Name="Event" FullName="Mono.Debugger.Soft.Event">
+  <TypeSignature Language="C#" Value="public abstract class Event" />
+  <AssemblyInfo>
+    <AssemblyName>Mono.Debugger.Soft</AssemblyName>
+    <AssemblyVersion>0.0.0.0</AssemblyVersion>
+  </AssemblyInfo>
+  <Base>
+    <BaseTypeName>System.Object</BaseTypeName>
+  </Base>
+  <Interfaces />
+  <Docs>
+    <summary>Represents an event occuring in the debuggee.</summary>
+    <remarks>
+      <format type="text/html">
+        <a href="http://java.sun.com/j2se/1.5.0/docs/guide/jpda/jdi/com/sun/jdi/event/Event.html">JDI Documentation</a>
+      </format>
+    </remarks>
+  </Docs>
+  <Members>
+    <Member MemberName="EventType">
+      <MemberSignature Language="C#" Value="public Mono.Debugger.Soft.EventType EventType { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.EventType</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="Request">
+      <MemberSignature Language="C#" Value="public Mono.Debugger.Soft.EventRequest Request { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.EventRequest</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="Thread">
+      <MemberSignature Language="C#" Value="public Mono.Debugger.Soft.ThreadMirror Thread { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.ThreadMirror</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="ToString">
+      <MemberSignature Language="C#" Value="public override string ToString ();" />
+      <MemberType>Method</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.String</ReturnType>
+      </ReturnValue>
+      <Parameters />
+      <Docs>
+        <summary>To be added.</summary>
+        <returns>To be added.</returns>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="vm">
+      <MemberSignature Language="C#" Value="protected Mono.Debugger.Soft.VirtualMachine vm;" />
+      <MemberType>Field</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.VirtualMachine</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+  </Members>
+</Type>
diff --git a/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/EventRequest.xml b/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/EventRequest.xml
new file mode 100644
index 0000000..9adc526
--- /dev/null
+++ b/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/EventRequest.xml
@@ -0,0 +1,259 @@
+<Type Name="EventRequest" FullName="Mono.Debugger.Soft.EventRequest">
+  <TypeSignature Language="C#" Value="public abstract class EventRequest" />
+  <AssemblyInfo>
+    <AssemblyName>Mono.Debugger.Soft</AssemblyName>
+    <AssemblyVersion>0.0.0.0</AssemblyVersion>
+  </AssemblyInfo>
+  <Base>
+    <BaseTypeName>System.Object</BaseTypeName>
+  </Base>
+  <Interfaces />
+  <Docs>
+    <summary>Request receiving a specific type of event.</summary>
+    <remarks>
+    </remarks>
+  </Docs>
+  <Members>
+    <Member MemberName="CheckDisabled">
+      <MemberSignature Language="C#" Value="protected void CheckDisabled ();" />
+      <MemberType>Method</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Void</ReturnType>
+      </ReturnValue>
+      <Parameters />
+      <Docs>
+        <summary>To be added.</summary>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="CheckMirror">
+      <MemberSignature Language="C#" Value="protected void CheckMirror (Mono.Debugger.Soft.VirtualMachine vm, Mono.Debugger.Soft.Mirror m);" />
+      <MemberType>Method</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Void</ReturnType>
+      </ReturnValue>
+      <Parameters>
+        <Parameter Name="vm" Type="Mono.Debugger.Soft.VirtualMachine" />
+        <Parameter Name="m" Type="Mono.Debugger.Soft.Mirror" />
+      </Parameters>
+      <Docs>
+        <param name="vm">To be added.</param>
+        <param name="m">To be added.</param>
+        <summary>To be added.</summary>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="count">
+      <MemberSignature Language="C#" Value="protected int count;" />
+      <MemberType>Field</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Int32</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="Count">
+      <MemberSignature Language="C#" Value="public int Count { set; get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Int32</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="Disable">
+      <MemberSignature Language="C#" Value="public void Disable ();" />
+      <MemberType>Method</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Void</ReturnType>
+      </ReturnValue>
+      <Parameters />
+      <Docs>
+        <summary>To be added.</summary>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="Enable">
+      <MemberSignature Language="C#" Value="public virtual void Enable ();" />
+      <MemberType>Method</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Void</ReturnType>
+      </ReturnValue>
+      <Parameters />
+      <Docs>
+        <summary>To be added.</summary>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="enabled">
+      <MemberSignature Language="C#" Value="protected bool enabled;" />
+      <MemberType>Field</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Boolean</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="Enabled">
+      <MemberSignature Language="C#" Value="public bool Enabled { set; get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Boolean</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="etype">
+      <MemberSignature Language="C#" Value="protected Mono.Debugger.Soft.EventType etype;" />
+      <MemberType>Field</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.EventType</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="EventType">
+      <MemberSignature Language="C#" Value="public Mono.Debugger.Soft.EventType EventType { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.EventType</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="id">
+      <MemberSignature Language="C#" Value="protected int id;" />
+      <MemberType>Field</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Int32</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="SetEnabled">
+      <MemberSignature Language="C#" Value="protected void SetEnabled (int id);" />
+      <MemberType>Method</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Void</ReturnType>
+      </ReturnValue>
+      <Parameters>
+        <Parameter Name="id" Type="System.Int32" />
+      </Parameters>
+      <Docs>
+        <param name="id">To be added.</param>
+        <summary>To be added.</summary>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="suspend">
+      <MemberSignature Language="C#" Value="protected Mono.Debugger.Soft.SuspendPolicy suspend;" />
+      <MemberType>Field</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.SuspendPolicy</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="thread">
+      <MemberSignature Language="C#" Value="protected Mono.Debugger.Soft.ThreadMirror thread;" />
+      <MemberType>Field</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.ThreadMirror</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="Thread">
+      <MemberSignature Language="C#" Value="public Mono.Debugger.Soft.ThreadMirror Thread { set; get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.ThreadMirror</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="vm">
+      <MemberSignature Language="C#" Value="protected Mono.Debugger.Soft.VirtualMachine vm;" />
+      <MemberType>Field</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.VirtualMachine</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+  </Members>
+</Type>
diff --git a/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/EventType.xml b/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/EventType.xml
new file mode 100644
index 0000000..876a063
--- /dev/null
+++ b/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/EventType.xml
@@ -0,0 +1,199 @@
+<Type Name="EventType" FullName="Mono.Debugger.Soft.EventType">
+  <TypeSignature Language="C#" Value="public enum EventType" />
+  <AssemblyInfo>
+    <AssemblyName>Mono.Debugger.Soft</AssemblyName>
+    <AssemblyVersion>0.0.0.0</AssemblyVersion>
+  </AssemblyInfo>
+  <Base>
+    <BaseTypeName>System.Enum</BaseTypeName>
+  </Base>
+  <Docs>
+    <summary>Possible types of events.</summary>
+    <remarks>
+    </remarks>
+  </Docs>
+  <Members>
+    <Member MemberName="AppDomainCreate">
+      <MemberSignature Language="C#" Value="AppDomainCreate" />
+      <MemberType>Field</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.EventType</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+      </Docs>
+    </Member>
+    <Member MemberName="AppDomainUnload">
+      <MemberSignature Language="C#" Value="AppDomainUnload" />
+      <MemberType>Field</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.EventType</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+      </Docs>
+    </Member>
+    <Member MemberName="AssemblyLoad">
+      <MemberSignature Language="C#" Value="AssemblyLoad" />
+      <MemberType>Field</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.EventType</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+      </Docs>
+    </Member>
+    <Member MemberName="AssemblyUnload">
+      <MemberSignature Language="C#" Value="AssemblyUnload" />
+      <MemberType>Field</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.EventType</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+      </Docs>
+    </Member>
+    <Member MemberName="Breakpoint">
+      <MemberSignature Language="C#" Value="Breakpoint" />
+      <MemberType>Field</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.EventType</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+      </Docs>
+    </Member>
+    <Member MemberName="MethodEntry">
+      <MemberSignature Language="C#" Value="MethodEntry" />
+      <MemberType>Field</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.EventType</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+      </Docs>
+    </Member>
+    <Member MemberName="MethodExit">
+      <MemberSignature Language="C#" Value="MethodExit" />
+      <MemberType>Field</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.EventType</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+      </Docs>
+    </Member>
+    <Member MemberName="Step">
+      <MemberSignature Language="C#" Value="Step" />
+      <MemberType>Field</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.EventType</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+      </Docs>
+    </Member>
+    <Member MemberName="ThreadDeath">
+      <MemberSignature Language="C#" Value="ThreadDeath" />
+      <MemberType>Field</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.EventType</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+      </Docs>
+    </Member>
+    <Member MemberName="ThreadStart">
+      <MemberSignature Language="C#" Value="ThreadStart" />
+      <MemberType>Field</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.EventType</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+      </Docs>
+    </Member>
+    <Member MemberName="TypeLoad">
+      <MemberSignature Language="C#" Value="TypeLoad" />
+      <MemberType>Field</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.EventType</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+      </Docs>
+    </Member>
+    <Member MemberName="VMDeath">
+      <MemberSignature Language="C#" Value="VMDeath" />
+      <MemberType>Field</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.EventType</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+      </Docs>
+    </Member>
+    <Member MemberName="VMDisconnect">
+      <MemberSignature Language="C#" Value="VMDisconnect" />
+      <MemberType>Field</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.EventType</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+      </Docs>
+    </Member>
+    <Member MemberName="VMStart">
+      <MemberSignature Language="C#" Value="VMStart" />
+      <MemberType>Field</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.EventType</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+      </Docs>
+    </Member>
+  </Members>
+</Type>
diff --git a/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/FieldInfoMirror.xml b/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/FieldInfoMirror.xml
new file mode 100644
index 0000000..75e4782
--- /dev/null
+++ b/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/FieldInfoMirror.xml
@@ -0,0 +1,321 @@
+<Type Name="FieldInfoMirror" FullName="Mono.Debugger.Soft.FieldInfoMirror">
+  <TypeSignature Language="C#" Value="public class FieldInfoMirror : Mono.Debugger.Soft.Mirror" />
+  <AssemblyInfo>
+    <AssemblyName>Mono.Debugger.Soft</AssemblyName>
+    <AssemblyVersion>0.0.0.0</AssemblyVersion>
+  </AssemblyInfo>
+  <Base>
+    <BaseTypeName>Mono.Debugger.Soft.Mirror</BaseTypeName>
+  </Base>
+  <Interfaces />
+  <Docs>
+    <summary>Represents a FieldInfo in the debuggee.</summary>
+    <remarks>
+    </remarks>
+  </Docs>
+  <Members>
+    <Member MemberName=".ctor">
+      <MemberSignature Language="C#" Value="public FieldInfoMirror (Mono.Debugger.Soft.TypeMirror parent, long id, string name, Mono.Debugger.Soft.TypeMirror type, System.Reflection.FieldAttributes attrs);" />
+      <MemberType>Constructor</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <Parameters>
+        <Parameter Name="parent" Type="Mono.Debugger.Soft.TypeMirror" />
+        <Parameter Name="id" Type="System.Int64" />
+        <Parameter Name="name" Type="System.String" />
+        <Parameter Name="type" Type="Mono.Debugger.Soft.TypeMirror" />
+        <Parameter Name="attrs" Type="System.Reflection.FieldAttributes" />
+      </Parameters>
+      <Docs>
+        <param name="parent">To be added.</param>
+        <param name="id">To be added.</param>
+        <param name="name">To be added.</param>
+        <param name="type">To be added.</param>
+        <param name="attrs">To be added.</param>
+        <summary>To be added.</summary>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="Attributes">
+      <MemberSignature Language="C#" Value="public System.Reflection.FieldAttributes Attributes { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Reflection.FieldAttributes</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="DeclaringType">
+      <MemberSignature Language="C#" Value="public Mono.Debugger.Soft.TypeMirror DeclaringType { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.TypeMirror</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="FieldType">
+      <MemberSignature Language="C#" Value="public Mono.Debugger.Soft.TypeMirror FieldType { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.TypeMirror</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="GetCustomAttributes">
+      <MemberSignature Language="C#" Value="public Mono.Debugger.Soft.CustomAttributeDataMirror[] GetCustomAttributes (bool inherit);" />
+      <MemberType>Method</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.CustomAttributeDataMirror[]</ReturnType>
+      </ReturnValue>
+      <Parameters>
+        <Parameter Name="inherit" Type="System.Boolean" />
+      </Parameters>
+      <Docs>
+        <param name="inherit">To be added.</param>
+        <summary>To be added.</summary>
+        <returns>To be added.</returns>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="GetCustomAttributes">
+      <MemberSignature Language="C#" Value="public Mono.Debugger.Soft.CustomAttributeDataMirror[] GetCustomAttributes (Mono.Debugger.Soft.TypeMirror attributeType, bool inherit);" />
+      <MemberType>Method</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.CustomAttributeDataMirror[]</ReturnType>
+      </ReturnValue>
+      <Parameters>
+        <Parameter Name="attributeType" Type="Mono.Debugger.Soft.TypeMirror" />
+        <Parameter Name="inherit" Type="System.Boolean" />
+      </Parameters>
+      <Docs>
+        <param name="attributeType">To be added.</param>
+        <param name="inherit">To be added.</param>
+        <summary>To be added.</summary>
+        <returns>To be added.</returns>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="IsAssembly">
+      <MemberSignature Language="C#" Value="public bool IsAssembly { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Boolean</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="IsFamily">
+      <MemberSignature Language="C#" Value="public bool IsFamily { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Boolean</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="IsFamilyAndAssembly">
+      <MemberSignature Language="C#" Value="public bool IsFamilyAndAssembly { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Boolean</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="IsFamilyOrAssembly">
+      <MemberSignature Language="C#" Value="public bool IsFamilyOrAssembly { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Boolean</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="IsInitOnly">
+      <MemberSignature Language="C#" Value="public bool IsInitOnly { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Boolean</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="IsLiteral">
+      <MemberSignature Language="C#" Value="public bool IsLiteral { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Boolean</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="IsNotSerialized">
+      <MemberSignature Language="C#" Value="public bool IsNotSerialized { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Boolean</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="IsPinvokeImpl">
+      <MemberSignature Language="C#" Value="public bool IsPinvokeImpl { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Boolean</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="IsPrivate">
+      <MemberSignature Language="C#" Value="public bool IsPrivate { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Boolean</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="IsPublic">
+      <MemberSignature Language="C#" Value="public bool IsPublic { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Boolean</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="IsSpecialName">
+      <MemberSignature Language="C#" Value="public bool IsSpecialName { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Boolean</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="IsStatic">
+      <MemberSignature Language="C#" Value="public bool IsStatic { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Boolean</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="Name">
+      <MemberSignature Language="C#" Value="public string Name { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.String</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+  </Members>
+</Type>
diff --git a/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/ILInstruction.xml b/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/ILInstruction.xml
new file mode 100644
index 0000000..6bc7e9f
--- /dev/null
+++ b/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/ILInstruction.xml
@@ -0,0 +1,93 @@
+<Type Name="ILInstruction" FullName="Mono.Debugger.Soft.ILInstruction">
+  <TypeSignature Language="C#" Value="public class ILInstruction" />
+  <AssemblyInfo>
+    <AssemblyName>Mono.Debugger.Soft</AssemblyName>
+    <AssemblyVersion>0.0.0.0</AssemblyVersion>
+  </AssemblyInfo>
+  <Base>
+    <BaseTypeName>System.Object</BaseTypeName>
+  </Base>
+  <Interfaces />
+  <Docs>
+    <summary>Represents an IL instruction.</summary>
+    <remarks>This is similar to the Instruction class in Cecil, we can't use that as its constructor is internal.
+</remarks>
+  </Docs>
+  <Members>
+    <Member MemberName="Next">
+      <MemberSignature Language="C#" Value="public Mono.Debugger.Soft.ILInstruction Next { set; get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.ILInstruction</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="Offset">
+      <MemberSignature Language="C#" Value="public int Offset { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Int32</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="OpCode">
+      <MemberSignature Language="C#" Value="public Mono.Cecil.Cil.OpCode OpCode { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Cecil.Cil.OpCode</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="Operand">
+      <MemberSignature Language="C#" Value="public object Operand { set; get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Object</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="Previous">
+      <MemberSignature Language="C#" Value="public Mono.Debugger.Soft.ILInstruction Previous { set; get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.ILInstruction</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+  </Members>
+</Type>
diff --git a/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/IMirror.xml b/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/IMirror.xml
new file mode 100644
index 0000000..2fe2359
--- /dev/null
+++ b/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/IMirror.xml
@@ -0,0 +1,35 @@
+<Type Name="IMirror" FullName="Mono.Debugger.Soft.IMirror">
+  <TypeSignature Language="C#" Value="public interface IMirror" />
+  <AssemblyInfo>
+    <AssemblyName>Mono.Debugger.Soft</AssemblyName>
+    <AssemblyVersion>0.0.0.0</AssemblyVersion>
+  </AssemblyInfo>
+  <Interfaces />
+  <Docs>
+    <summary>Represents an entity in the debuggee.</summary>
+    <remarks>
+      <format type="text/html">
+        <a href="http://java.sun.com/j2se/1.5.0/docs/guide/jpda/jdi/com/sun/jdi/Mirror.html">JDI Documentation</a>
+      </format>
+    </remarks>
+  </Docs>
+  <Members>
+    <Member MemberName="VirtualMachine">
+      <MemberSignature Language="C#" Value="public Mono.Debugger.Soft.VirtualMachine VirtualMachine { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.VirtualMachine</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>Returns the virtual machine this entity belongs to.</summary>
+        <value>
+        </value>
+        <remarks>
+        </remarks>
+      </Docs>
+    </Member>
+  </Members>
+</Type>
diff --git a/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/InvalidStackFrameException.xml b/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/InvalidStackFrameException.xml
new file mode 100644
index 0000000..aeae698
--- /dev/null
+++ b/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/InvalidStackFrameException.xml
@@ -0,0 +1,30 @@
+<Type Name="InvalidStackFrameException" FullName="Mono.Debugger.Soft.InvalidStackFrameException">
+  <TypeSignature Language="C#" Value="public class InvalidStackFrameException : Exception" />
+  <AssemblyInfo>
+    <AssemblyName>Mono.Debugger.Soft</AssemblyName>
+    <AssemblyVersion>0.0.0.0</AssemblyVersion>
+  </AssemblyInfo>
+  <Base>
+    <BaseTypeName>System.Exception</BaseTypeName>
+  </Base>
+  <Interfaces />
+  <Docs>
+    <summary>Thrown when a stack frame is accessed which belongs to a thread which was resumed.</summary>
+    <remarks>
+    </remarks>
+  </Docs>
+  <Members>
+    <Member MemberName=".ctor">
+      <MemberSignature Language="C#" Value="public InvalidStackFrameException ();" />
+      <MemberType>Constructor</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <Parameters />
+      <Docs>
+        <summary>To be added.</summary>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+  </Members>
+</Type>
diff --git a/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/InvocationException.xml b/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/InvocationException.xml
new file mode 100644
index 0000000..adb31f8
--- /dev/null
+++ b/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/InvocationException.xml
@@ -0,0 +1,47 @@
+<Type Name="InvocationException" FullName="Mono.Debugger.Soft.InvocationException">
+  <TypeSignature Language="C#" Value="public class InvocationException : Exception" />
+  <AssemblyInfo>
+    <AssemblyName>Mono.Debugger.Soft</AssemblyName>
+    <AssemblyVersion>0.0.0.0</AssemblyVersion>
+  </AssemblyInfo>
+  <Base>
+    <BaseTypeName>System.Exception</BaseTypeName>
+  </Base>
+  <Interfaces />
+  <Docs>
+    <summary>To be added.</summary>
+    <remarks>To be added.</remarks>
+  </Docs>
+  <Members>
+    <Member MemberName=".ctor">
+      <MemberSignature Language="C#" Value="public InvocationException (Mono.Debugger.Soft.ObjectMirror exception);" />
+      <MemberType>Constructor</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <Parameters>
+        <Parameter Name="exception" Type="Mono.Debugger.Soft.ObjectMirror" />
+      </Parameters>
+      <Docs>
+        <param name="exception">To be added.</param>
+        <summary>To be added.</summary>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="Exception">
+      <MemberSignature Language="C#" Value="public Mono.Debugger.Soft.ObjectMirror Exception { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.ObjectMirror</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+  </Members>
+</Type>
diff --git a/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/LaunchOptions.xml b/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/LaunchOptions.xml
new file mode 100644
index 0000000..54cc7d8
--- /dev/null
+++ b/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/LaunchOptions.xml
@@ -0,0 +1,89 @@
+<Type Name="LaunchOptions" FullName="Mono.Debugger.Soft.LaunchOptions">
+  <TypeSignature Language="C#" Value="public class LaunchOptions" />
+  <AssemblyInfo>
+    <AssemblyName>Mono.Debugger.Soft</AssemblyName>
+    <AssemblyVersion>0.0.0.0</AssemblyVersion>
+  </AssemblyInfo>
+  <Base>
+    <BaseTypeName>System.Object</BaseTypeName>
+  </Base>
+  <Interfaces />
+  <Docs>
+    <summary>Options used to control <see cref="M:Mono.Debugger.Soft.VirtualMachineManager.Launch(System.String[],Mono.Debugger.Soft.LaunchOptions)" />.</summary>
+    <remarks>To be added.</remarks>
+  </Docs>
+  <Members>
+    <Member MemberName=".ctor">
+      <MemberSignature Language="C#" Value="public LaunchOptions ();" />
+      <MemberType>Constructor</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <Parameters />
+      <Docs>
+        <summary>To be added.</summary>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="AgentArgs">
+      <MemberSignature Language="C#" Value="public string AgentArgs { set; get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.String</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>Additional arguments to pass to the mono runtime debugging agent at startup.</summary>
+        <value>To be added.</value>
+        <remarks>A comma separate list of arguments, run mono with --debugger-agent=help for more information. Defaults to null.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="RedirectStandardOutput">
+      <MemberSignature Language="C#" Value="public bool RedirectStandardOutput { set; get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Boolean</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>Sets the ProcessStartInfo.RedirectStandardOutput option when launching the process.</summary>
+        <value>To be added.</value>
+        <remarks>Defaults to false.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="Runtime">
+      <MemberSignature Language="C#" Value="public string Runtime { set; get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.String</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="Valgrind">
+      <MemberSignature Language="C#" Value="public bool Valgrind { set; get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Boolean</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>Run the process under valgrind.</summary>
+        <value>To be added.</value>
+        <remarks>Defaults to false.</remarks>
+      </Docs>
+    </Member>
+  </Members>
+</Type>
diff --git a/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/LocalVariable.xml b/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/LocalVariable.xml
new file mode 100644
index 0000000..ec614b0
--- /dev/null
+++ b/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/LocalVariable.xml
@@ -0,0 +1,93 @@
+<Type Name="LocalVariable" FullName="Mono.Debugger.Soft.LocalVariable">
+  <TypeSignature Language="C#" Value="public class LocalVariable : Mono.Debugger.Soft.Mirror" />
+  <AssemblyInfo>
+    <AssemblyName>Mono.Debugger.Soft</AssemblyName>
+    <AssemblyVersion>0.0.0.0</AssemblyVersion>
+  </AssemblyInfo>
+  <Base>
+    <BaseTypeName>Mono.Debugger.Soft.Mirror</BaseTypeName>
+  </Base>
+  <Interfaces />
+  <Docs>
+    <summary>Represents a local variable of a method.</summary>
+    <remarks>
+    </remarks>
+  </Docs>
+  <Members>
+    <Member MemberName="Index">
+      <MemberSignature Language="C#" Value="public int Index { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Int32</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="IsArg">
+      <MemberSignature Language="C#" Value="public bool IsArg { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Boolean</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="Method">
+      <MemberSignature Language="C#" Value="public Mono.Debugger.Soft.MethodMirror Method { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.MethodMirror</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="Name">
+      <MemberSignature Language="C#" Value="public string Name { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.String</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="Type">
+      <MemberSignature Language="C#" Value="public Mono.Debugger.Soft.TypeMirror Type { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.TypeMirror</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+  </Members>
+</Type>
diff --git a/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/Location.xml b/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/Location.xml
new file mode 100644
index 0000000..20edfe1
--- /dev/null
+++ b/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/Location.xml
@@ -0,0 +1,78 @@
+<Type Name="Location" FullName="Mono.Debugger.Soft.Location">
+  <TypeSignature Language="C#" Value="public class Location : Mono.Debugger.Soft.Mirror" />
+  <AssemblyInfo>
+    <AssemblyName>Mono.Debugger.Soft</AssemblyName>
+    <AssemblyVersion>0.0.0.0</AssemblyVersion>
+  </AssemblyInfo>
+  <Base>
+    <BaseTypeName>Mono.Debugger.Soft.Mirror</BaseTypeName>
+  </Base>
+  <Interfaces />
+  <Docs>
+    <summary>Represents an executable location in the debuggee.</summary>
+    <remarks>
+    </remarks>
+  </Docs>
+  <Members>
+    <Member MemberName="ILOffset">
+      <MemberSignature Language="C#" Value="public int ILOffset { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Int32</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="LineNumber">
+      <MemberSignature Language="C#" Value="public int LineNumber { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Int32</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="Method">
+      <MemberSignature Language="C#" Value="public Mono.Debugger.Soft.MethodMirror Method { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.MethodMirror</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="SourceFile">
+      <MemberSignature Language="C#" Value="public string SourceFile { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.String</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+  </Members>
+</Type>
diff --git a/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/MethodBodyMirror.xml b/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/MethodBodyMirror.xml
new file mode 100644
index 0000000..e30700e
--- /dev/null
+++ b/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/MethodBodyMirror.xml
@@ -0,0 +1,64 @@
+<Type Name="MethodBodyMirror" FullName="Mono.Debugger.Soft.MethodBodyMirror">
+  <TypeSignature Language="C#" Value="public class MethodBodyMirror : Mono.Debugger.Soft.Mirror" />
+  <AssemblyInfo>
+    <AssemblyName>Mono.Debugger.Soft</AssemblyName>
+    <AssemblyVersion>0.0.0.0</AssemblyVersion>
+  </AssemblyInfo>
+  <Base>
+    <BaseTypeName>Mono.Debugger.Soft.Mirror</BaseTypeName>
+  </Base>
+  <Interfaces />
+  <Docs>
+    <summary>Represents a MethodBody in the debuggee.</summary>
+    <remarks>
+    </remarks>
+  </Docs>
+  <Members>
+    <Member MemberName="GetILAsByteArray">
+      <MemberSignature Language="C#" Value="public byte[] GetILAsByteArray ();" />
+      <MemberType>Method</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Byte[]</ReturnType>
+      </ReturnValue>
+      <Parameters />
+      <Docs>
+        <summary>To be added.</summary>
+        <returns>To be added.</returns>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="Instructions">
+      <MemberSignature Language="C#" Value="public System.Collections.Generic.List<Mono.Debugger.Soft.ILInstruction> Instructions { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Collections.Generic.List<Mono.Debugger.Soft.ILInstruction></ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="Method">
+      <MemberSignature Language="C#" Value="public Mono.Debugger.Soft.MethodMirror Method { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.MethodMirror</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+  </Members>
+</Type>
diff --git a/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/MethodEntryEvent.xml b/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/MethodEntryEvent.xml
new file mode 100644
index 0000000..a050e81
--- /dev/null
+++ b/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/MethodEntryEvent.xml
@@ -0,0 +1,33 @@
+<Type Name="MethodEntryEvent" FullName="Mono.Debugger.Soft.MethodEntryEvent">
+  <TypeSignature Language="C#" Value="public class MethodEntryEvent : Mono.Debugger.Soft.Event" />
+  <AssemblyInfo>
+    <AssemblyName>Mono.Debugger.Soft</AssemblyName>
+    <AssemblyVersion>0.0.0.0</AssemblyVersion>
+  </AssemblyInfo>
+  <Base>
+    <BaseTypeName>Mono.Debugger.Soft.Event</BaseTypeName>
+  </Base>
+  <Interfaces />
+  <Docs>
+    <summary>Sent when a MethodEntry event occurs in the debuggee.</summary>
+    <remarks>
+    </remarks>
+  </Docs>
+  <Members>
+    <Member MemberName="Method">
+      <MemberSignature Language="C#" Value="public Mono.Debugger.Soft.MethodMirror Method { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.MethodMirror</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+  </Members>
+</Type>
diff --git a/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/MethodEntryEventRequest.xml b/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/MethodEntryEventRequest.xml
new file mode 100644
index 0000000..0033fe6
--- /dev/null
+++ b/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/MethodEntryEventRequest.xml
@@ -0,0 +1,17 @@
+<Type Name="MethodEntryEventRequest" FullName="Mono.Debugger.Soft.MethodEntryEventRequest">
+  <TypeSignature Language="C#" Value="public sealed class MethodEntryEventRequest : Mono.Debugger.Soft.EventRequest" />
+  <AssemblyInfo>
+    <AssemblyName>Mono.Debugger.Soft</AssemblyName>
+    <AssemblyVersion>0.0.0.0</AssemblyVersion>
+  </AssemblyInfo>
+  <Base>
+    <BaseTypeName>Mono.Debugger.Soft.EventRequest</BaseTypeName>
+  </Base>
+  <Interfaces />
+  <Docs>
+    <summary>Request for MethodEntry events.</summary>
+    <remarks>
+    </remarks>
+  </Docs>
+  <Members />
+</Type>
diff --git a/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/MethodExitEvent.xml b/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/MethodExitEvent.xml
new file mode 100644
index 0000000..39a0b1c
--- /dev/null
+++ b/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/MethodExitEvent.xml
@@ -0,0 +1,33 @@
+<Type Name="MethodExitEvent" FullName="Mono.Debugger.Soft.MethodExitEvent">
+  <TypeSignature Language="C#" Value="public class MethodExitEvent : Mono.Debugger.Soft.Event" />
+  <AssemblyInfo>
+    <AssemblyName>Mono.Debugger.Soft</AssemblyName>
+    <AssemblyVersion>0.0.0.0</AssemblyVersion>
+  </AssemblyInfo>
+  <Base>
+    <BaseTypeName>Mono.Debugger.Soft.Event</BaseTypeName>
+  </Base>
+  <Interfaces />
+  <Docs>
+    <summary>Sent when a MethodExit event occurs in the debuggee.</summary>
+    <remarks>
+    </remarks>
+  </Docs>
+  <Members>
+    <Member MemberName="Method">
+      <MemberSignature Language="C#" Value="public Mono.Debugger.Soft.MethodMirror Method { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.MethodMirror</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+  </Members>
+</Type>
diff --git a/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/MethodExitEventRequest.xml b/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/MethodExitEventRequest.xml
new file mode 100644
index 0000000..6de0ddf
--- /dev/null
+++ b/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/MethodExitEventRequest.xml
@@ -0,0 +1,17 @@
+<Type Name="MethodExitEventRequest" FullName="Mono.Debugger.Soft.MethodExitEventRequest">
+  <TypeSignature Language="C#" Value="public sealed class MethodExitEventRequest : Mono.Debugger.Soft.EventRequest" />
+  <AssemblyInfo>
+    <AssemblyName>Mono.Debugger.Soft</AssemblyName>
+    <AssemblyVersion>0.0.0.0</AssemblyVersion>
+  </AssemblyInfo>
+  <Base>
+    <BaseTypeName>Mono.Debugger.Soft.EventRequest</BaseTypeName>
+  </Base>
+  <Interfaces />
+  <Docs>
+    <summary>Request for MethodExit events.</summary>
+    <remarks>
+    </remarks>
+  </Docs>
+  <Members />
+</Type>
diff --git a/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/MethodMirror.xml b/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/MethodMirror.xml
new file mode 100644
index 0000000..544b29d
--- /dev/null
+++ b/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/MethodMirror.xml
@@ -0,0 +1,479 @@
+<Type Name="MethodMirror" FullName="Mono.Debugger.Soft.MethodMirror">
+  <TypeSignature Language="C#" Value="public class MethodMirror : Mono.Debugger.Soft.Mirror" />
+  <AssemblyInfo>
+    <AssemblyName>Mono.Debugger.Soft</AssemblyName>
+    <AssemblyVersion>0.0.0.0</AssemblyVersion>
+  </AssemblyInfo>
+  <Base>
+    <BaseTypeName>Mono.Debugger.Soft.Mirror</BaseTypeName>
+  </Base>
+  <Interfaces />
+  <Docs>
+    <summary>Represents a MethodInfo in the debuggee.</summary>
+    <remarks>
+    </remarks>
+  </Docs>
+  <Members>
+    <Member MemberName="Attributes">
+      <MemberSignature Language="C#" Value="public System.Reflection.MethodAttributes Attributes { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Reflection.MethodAttributes</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="DeclaringType">
+      <MemberSignature Language="C#" Value="public Mono.Debugger.Soft.TypeMirror DeclaringType { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.TypeMirror</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="FullName">
+      <MemberSignature Language="C#" Value="public string FullName { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.String</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="GetLocal">
+      <MemberSignature Language="C#" Value="public Mono.Debugger.Soft.LocalVariable GetLocal (string name);" />
+      <MemberType>Method</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.LocalVariable</ReturnType>
+      </ReturnValue>
+      <Parameters>
+        <Parameter Name="name" Type="System.String" />
+      </Parameters>
+      <Docs>
+        <param name="name">To be added.</param>
+        <summary>To be added.</summary>
+        <returns>To be added.</returns>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="GetLocals">
+      <MemberSignature Language="C#" Value="public Mono.Debugger.Soft.LocalVariable[] GetLocals ();" />
+      <MemberType>Method</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.LocalVariable[]</ReturnType>
+      </ReturnValue>
+      <Parameters />
+      <Docs>
+        <summary>To be added.</summary>
+        <returns>To be added.</returns>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="GetMethodBody">
+      <MemberSignature Language="C#" Value="public Mono.Debugger.Soft.MethodBodyMirror GetMethodBody ();" />
+      <MemberType>Method</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.MethodBodyMirror</ReturnType>
+      </ReturnValue>
+      <Parameters />
+      <Docs>
+        <summary>To be added.</summary>
+        <returns>To be added.</returns>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="GetParameters">
+      <MemberSignature Language="C#" Value="public Mono.Debugger.Soft.ParameterInfoMirror[] GetParameters ();" />
+      <MemberType>Method</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.ParameterInfoMirror[]</ReturnType>
+      </ReturnValue>
+      <Parameters />
+      <Docs>
+        <summary>To be added.</summary>
+        <returns>To be added.</returns>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="ILOffsets">
+      <MemberSignature Language="C#" Value="public System.Collections.Generic.IList<int> ILOffsets { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Collections.Generic.IList<System.Int32></ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="IsAbstract">
+      <MemberSignature Language="C#" Value="public bool IsAbstract { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Boolean</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="IsAssembly">
+      <MemberSignature Language="C#" Value="public bool IsAssembly { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Boolean</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="IsConstructor">
+      <MemberSignature Language="C#" Value="public bool IsConstructor { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Boolean</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="IsFamily">
+      <MemberSignature Language="C#" Value="public bool IsFamily { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Boolean</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="IsFamilyAndAssembly">
+      <MemberSignature Language="C#" Value="public bool IsFamilyAndAssembly { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Boolean</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="IsFamilyOrAssembly">
+      <MemberSignature Language="C#" Value="public bool IsFamilyOrAssembly { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Boolean</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="IsFinal">
+      <MemberSignature Language="C#" Value="public bool IsFinal { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Boolean</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="IsHideBySig">
+      <MemberSignature Language="C#" Value="public bool IsHideBySig { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Boolean</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="IsPrivate">
+      <MemberSignature Language="C#" Value="public bool IsPrivate { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Boolean</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="IsPublic">
+      <MemberSignature Language="C#" Value="public bool IsPublic { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Boolean</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="IsSpecialName">
+      <MemberSignature Language="C#" Value="public bool IsSpecialName { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Boolean</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="IsStatic">
+      <MemberSignature Language="C#" Value="public bool IsStatic { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Boolean</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="IsVirtual">
+      <MemberSignature Language="C#" Value="public bool IsVirtual { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Boolean</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="LineNumbers">
+      <MemberSignature Language="C#" Value="public System.Collections.Generic.IList<int> LineNumbers { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Collections.Generic.IList<System.Int32></ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="LocationAtILOffset">
+      <MemberSignature Language="C#" Value="public Mono.Debugger.Soft.Location LocationAtILOffset (int il_offset);" />
+      <MemberType>Method</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.Location</ReturnType>
+      </ReturnValue>
+      <Parameters>
+        <Parameter Name="il_offset" Type="System.Int32" />
+      </Parameters>
+      <Docs>
+        <param name="il_offset">To be added.</param>
+        <summary>To be added.</summary>
+        <returns>To be added.</returns>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="Locations">
+      <MemberSignature Language="C#" Value="public System.Collections.Generic.IList<Mono.Debugger.Soft.Location> Locations { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Collections.Generic.IList<Mono.Debugger.Soft.Location></ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="Metadata">
+      <MemberSignature Language="C#" Value="public Mono.Cecil.MethodDefinition Metadata { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Cecil.MethodDefinition</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="MetadataToken">
+      <MemberSignature Language="C#" Value="public int MetadataToken { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Int32</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="Name">
+      <MemberSignature Language="C#" Value="public string Name { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.String</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="ReturnParameter">
+      <MemberSignature Language="C#" Value="public Mono.Debugger.Soft.ParameterInfoMirror ReturnParameter { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.ParameterInfoMirror</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="ReturnType">
+      <MemberSignature Language="C#" Value="public Mono.Debugger.Soft.TypeMirror ReturnType { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.TypeMirror</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="SourceFile">
+      <MemberSignature Language="C#" Value="public string SourceFile { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.String</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+  </Members>
+</Type>
diff --git a/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/Mirror.xml b/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/Mirror.xml
new file mode 100644
index 0000000..ea39681
--- /dev/null
+++ b/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/Mirror.xml
@@ -0,0 +1,101 @@
+<Type Name="Mirror" FullName="Mono.Debugger.Soft.Mirror">
+  <TypeSignature Language="C#" Value="public abstract class Mirror : Mono.Debugger.Soft.IMirror" />
+  <AssemblyInfo>
+    <AssemblyName>Mono.Debugger.Soft</AssemblyName>
+    <AssemblyVersion>0.0.0.0</AssemblyVersion>
+  </AssemblyInfo>
+  <Base>
+    <BaseTypeName>System.Object</BaseTypeName>
+  </Base>
+  <Interfaces>
+    <Interface>
+      <InterfaceName>Mono.Debugger.Soft.IMirror</InterfaceName>
+    </Interface>
+  </Interfaces>
+  <Docs>
+    <summary>Base class for mirror objects.</summary>
+    <remarks>
+    </remarks>
+  </Docs>
+  <Members>
+    <Member MemberName="CheckMirror">
+      <MemberSignature Language="C#" Value="protected void CheckMirror (Mono.Debugger.Soft.Mirror m);" />
+      <MemberType>Method</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Void</ReturnType>
+      </ReturnValue>
+      <Parameters>
+        <Parameter Name="m" Type="Mono.Debugger.Soft.Mirror" />
+      </Parameters>
+      <Docs>
+        <param name="m">To be added.</param>
+        <summary>To be added.</summary>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="id">
+      <MemberSignature Language="C#" Value="protected long id;" />
+      <MemberType>Field</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Int64</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="SetVirtualMachine">
+      <MemberSignature Language="C#" Value="protected void SetVirtualMachine (Mono.Debugger.Soft.VirtualMachine vm);" />
+      <MemberType>Method</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Void</ReturnType>
+      </ReturnValue>
+      <Parameters>
+        <Parameter Name="vm" Type="Mono.Debugger.Soft.VirtualMachine" />
+      </Parameters>
+      <Docs>
+        <param name="vm">To be added.</param>
+        <summary>To be added.</summary>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="VirtualMachine">
+      <MemberSignature Language="C#" Value="public Mono.Debugger.Soft.VirtualMachine VirtualMachine { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.VirtualMachine</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="vm">
+      <MemberSignature Language="C#" Value="protected Mono.Debugger.Soft.VirtualMachine vm;" />
+      <MemberType>Field</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.VirtualMachine</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+  </Members>
+</Type>
diff --git a/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/ModuleMirror.xml b/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/ModuleMirror.xml
new file mode 100644
index 0000000..df3845d
--- /dev/null
+++ b/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/ModuleMirror.xml
@@ -0,0 +1,93 @@
+<Type Name="ModuleMirror" FullName="Mono.Debugger.Soft.ModuleMirror">
+  <TypeSignature Language="C#" Value="public class ModuleMirror : Mono.Debugger.Soft.Mirror" />
+  <AssemblyInfo>
+    <AssemblyName>Mono.Debugger.Soft</AssemblyName>
+    <AssemblyVersion>0.0.0.0</AssemblyVersion>
+  </AssemblyInfo>
+  <Base>
+    <BaseTypeName>Mono.Debugger.Soft.Mirror</BaseTypeName>
+  </Base>
+  <Interfaces />
+  <Docs>
+    <summary>Represents a Module in the debuggee.</summary>
+    <remarks>
+    </remarks>
+  </Docs>
+  <Members>
+    <Member MemberName="Assembly">
+      <MemberSignature Language="C#" Value="public Mono.Debugger.Soft.AssemblyMirror Assembly { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.AssemblyMirror</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="FullyQualifiedName">
+      <MemberSignature Language="C#" Value="public string FullyQualifiedName { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.String</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="ModuleVersionId">
+      <MemberSignature Language="C#" Value="public Guid ModuleVersionId { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Guid</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="Name">
+      <MemberSignature Language="C#" Value="public string Name { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.String</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="ScopeName">
+      <MemberSignature Language="C#" Value="public string ScopeName { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.String</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+  </Members>
+</Type>
diff --git a/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/ObjectCollectedException.xml b/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/ObjectCollectedException.xml
new file mode 100644
index 0000000..348c3db
--- /dev/null
+++ b/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/ObjectCollectedException.xml
@@ -0,0 +1,30 @@
+<Type Name="ObjectCollectedException" FullName="Mono.Debugger.Soft.ObjectCollectedException">
+  <TypeSignature Language="C#" Value="public class ObjectCollectedException : Exception" />
+  <AssemblyInfo>
+    <AssemblyName>Mono.Debugger.Soft</AssemblyName>
+    <AssemblyVersion>0.0.0.0</AssemblyVersion>
+  </AssemblyInfo>
+  <Base>
+    <BaseTypeName>System.Exception</BaseTypeName>
+  </Base>
+  <Interfaces />
+  <Docs>
+    <summary>Thrown when a attempt was made to access the state of a garbage collected object.</summary>
+    <remarks>
+    </remarks>
+  </Docs>
+  <Members>
+    <Member MemberName=".ctor">
+      <MemberSignature Language="C#" Value="public ObjectCollectedException ();" />
+      <MemberType>Constructor</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <Parameters />
+      <Docs>
+        <summary>To be added.</summary>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+  </Members>
+</Type>
diff --git a/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/ObjectMirror.xml b/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/ObjectMirror.xml
new file mode 100644
index 0000000..ed5d156
--- /dev/null
+++ b/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/ObjectMirror.xml
@@ -0,0 +1,179 @@
+<Type Name="ObjectMirror" FullName="Mono.Debugger.Soft.ObjectMirror">
+  <TypeSignature Language="C#" Value="public class ObjectMirror : Mono.Debugger.Soft.Value" />
+  <AssemblyInfo>
+    <AssemblyName>Mono.Debugger.Soft</AssemblyName>
+    <AssemblyVersion>0.0.0.0</AssemblyVersion>
+  </AssemblyInfo>
+  <Base>
+    <BaseTypeName>Mono.Debugger.Soft.Value</BaseTypeName>
+  </Base>
+  <Interfaces />
+  <Docs>
+    <summary>Represents an object in the debuggee.</summary>
+    <remarks>
+    </remarks>
+  </Docs>
+  <Members>
+    <Member MemberName="Address">
+      <MemberSignature Language="C#" Value="public long Address { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Int64</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="Domain">
+      <MemberSignature Language="C#" Value="public Mono.Debugger.Soft.AppDomainMirror Domain { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.AppDomainMirror</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="GetValue">
+      <MemberSignature Language="C#" Value="public Mono.Debugger.Soft.Value GetValue (Mono.Debugger.Soft.FieldInfoMirror field);" />
+      <MemberType>Method</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.Value</ReturnType>
+      </ReturnValue>
+      <Parameters>
+        <Parameter Name="field" Type="Mono.Debugger.Soft.FieldInfoMirror" />
+      </Parameters>
+      <Docs>
+        <param name="field">To be added.</param>
+        <summary>To be added.</summary>
+        <returns>To be added.</returns>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="GetValues">
+      <MemberSignature Language="C#" Value="public Mono.Debugger.Soft.Value[] GetValues (System.Collections.Generic.IList<Mono.Debugger.Soft.FieldInfoMirror> fields);" />
+      <MemberType>Method</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.Value[]</ReturnType>
+      </ReturnValue>
+      <Parameters>
+        <Parameter Name="fields" Type="System.Collections.Generic.IList<Mono.Debugger.Soft.FieldInfoMirror>" />
+      </Parameters>
+      <Docs>
+        <param name="fields">To be added.</param>
+        <summary>To be added.</summary>
+        <returns>To be added.</returns>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="InvokeMethod">
+      <MemberSignature Language="C#" Value="public Mono.Debugger.Soft.Value InvokeMethod (Mono.Debugger.Soft.ThreadMirror thread, Mono.Debugger.Soft.MethodMirror method, System.Collections.Generic.IList<Mono.Debugger.Soft.Value> arguments);" />
+      <MemberType>Method</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.Value</ReturnType>
+      </ReturnValue>
+      <Parameters>
+        <Parameter Name="thread" Type="Mono.Debugger.Soft.ThreadMirror" />
+        <Parameter Name="method" Type="Mono.Debugger.Soft.MethodMirror" />
+        <Parameter Name="arguments" Type="System.Collections.Generic.IList<Mono.Debugger.Soft.Value>" />
+      </Parameters>
+      <Docs>
+        <param name="thread">To be added.</param>
+        <param name="method">To be added.</param>
+        <param name="arguments">To be added.</param>
+        <summary>To be added.</summary>
+        <returns>To be added.</returns>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="IsCollected">
+      <MemberSignature Language="C#" Value="public bool IsCollected { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Boolean</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="SetValue">
+      <MemberSignature Language="C#" Value="public void SetValue (Mono.Debugger.Soft.FieldInfoMirror field, Mono.Debugger.Soft.Value value);" />
+      <MemberType>Method</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Void</ReturnType>
+      </ReturnValue>
+      <Parameters>
+        <Parameter Name="field" Type="Mono.Debugger.Soft.FieldInfoMirror" />
+        <Parameter Name="value" Type="Mono.Debugger.Soft.Value" />
+      </Parameters>
+      <Docs>
+        <param name="field">To be added.</param>
+        <param name="value">To be added.</param>
+        <summary>To be added.</summary>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="SetValues">
+      <MemberSignature Language="C#" Value="public void SetValues (System.Collections.Generic.IList<Mono.Debugger.Soft.FieldInfoMirror> fields, Mono.Debugger.Soft.Value[] values);" />
+      <MemberType>Method</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Void</ReturnType>
+      </ReturnValue>
+      <Parameters>
+        <Parameter Name="fields" Type="System.Collections.Generic.IList<Mono.Debugger.Soft.FieldInfoMirror>" />
+        <Parameter Name="values" Type="Mono.Debugger.Soft.Value[]" />
+      </Parameters>
+      <Docs>
+        <param name="fields">To be added.</param>
+        <param name="values">To be added.</param>
+        <summary>To be added.</summary>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="Type">
+      <MemberSignature Language="C#" Value="public Mono.Debugger.Soft.TypeMirror Type { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.TypeMirror</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+  </Members>
+</Type>
diff --git a/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/ParameterInfoMirror.xml b/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/ParameterInfoMirror.xml
new file mode 100644
index 0000000..97e1315
--- /dev/null
+++ b/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/ParameterInfoMirror.xml
@@ -0,0 +1,124 @@
+<Type Name="ParameterInfoMirror" FullName="Mono.Debugger.Soft.ParameterInfoMirror">
+  <TypeSignature Language="C#" Value="public class ParameterInfoMirror : Mono.Debugger.Soft.Mirror" />
+  <AssemblyInfo>
+    <AssemblyName>Mono.Debugger.Soft</AssemblyName>
+    <AssemblyVersion>0.0.0.0</AssemblyVersion>
+  </AssemblyInfo>
+  <Base>
+    <BaseTypeName>Mono.Debugger.Soft.Mirror</BaseTypeName>
+  </Base>
+  <Interfaces />
+  <Docs>
+    <summary>Represents a ParameterInfo in the debuggee.</summary>
+    <remarks>
+    </remarks>
+  </Docs>
+  <Members>
+    <Member MemberName="Attributes">
+      <MemberSignature Language="C#" Value="public System.Reflection.ParameterAttributes Attributes { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Reflection.ParameterAttributes</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="IsRetval">
+      <MemberSignature Language="C#" Value="public bool IsRetval { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Boolean</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="Method">
+      <MemberSignature Language="C#" Value="public Mono.Debugger.Soft.MethodMirror Method { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.MethodMirror</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="Name">
+      <MemberSignature Language="C#" Value="public string Name { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.String</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="ParameterType">
+      <MemberSignature Language="C#" Value="public Mono.Debugger.Soft.TypeMirror ParameterType { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.TypeMirror</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="Position">
+      <MemberSignature Language="C#" Value="public int Position { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Int32</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="ToString">
+      <MemberSignature Language="C#" Value="public override string ToString ();" />
+      <MemberType>Method</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.String</ReturnType>
+      </ReturnValue>
+      <Parameters />
+      <Docs>
+        <summary>To be added.</summary>
+        <returns>To be added.</returns>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+  </Members>
+</Type>
diff --git a/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/PrimitiveValue.xml b/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/PrimitiveValue.xml
new file mode 100644
index 0000000..5f04819
--- /dev/null
+++ b/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/PrimitiveValue.xml
@@ -0,0 +1,100 @@
+<Type Name="PrimitiveValue" FullName="Mono.Debugger.Soft.PrimitiveValue">
+  <TypeSignature Language="C#" Value="public class PrimitiveValue : Mono.Debugger.Soft.Value" />
+  <AssemblyInfo>
+    <AssemblyName>Mono.Debugger.Soft</AssemblyName>
+    <AssemblyVersion>0.0.0.0</AssemblyVersion>
+  </AssemblyInfo>
+  <Base>
+    <BaseTypeName>Mono.Debugger.Soft.Value</BaseTypeName>
+  </Base>
+  <Interfaces />
+  <Docs>
+    <summary>Represents a value of a primitive type in the debuggee.</summary>
+    <remarks>IntPtr values are represented as Int64 values since the debuggee might have a different word size.</remarks>
+  </Docs>
+  <Members>
+    <Member MemberName=".ctor">
+      <MemberSignature Language="C#" Value="public PrimitiveValue (Mono.Debugger.Soft.VirtualMachine vm, object value);" />
+      <MemberType>Constructor</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <Parameters>
+        <Parameter Name="vm" Type="Mono.Debugger.Soft.VirtualMachine" />
+        <Parameter Name="value" Type="System.Object" />
+      </Parameters>
+      <Docs>
+        <param name="vm">To be added.</param>
+        <param name="value">To be added.</param>
+        <summary>To be added.</summary>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="Equals">
+      <MemberSignature Language="C#" Value="public override bool Equals (object obj);" />
+      <MemberType>Method</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Boolean</ReturnType>
+      </ReturnValue>
+      <Parameters>
+        <Parameter Name="obj" Type="System.Object" />
+      </Parameters>
+      <Docs>
+        <param name="obj">To be added.</param>
+        <summary>To be added.</summary>
+        <returns>To be added.</returns>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="GetHashCode">
+      <MemberSignature Language="C#" Value="public override int GetHashCode ();" />
+      <MemberType>Method</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Int32</ReturnType>
+      </ReturnValue>
+      <Parameters />
+      <Docs>
+        <summary>To be added.</summary>
+        <returns>To be added.</returns>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="ToString">
+      <MemberSignature Language="C#" Value="public override string ToString ();" />
+      <MemberType>Method</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.String</ReturnType>
+      </ReturnValue>
+      <Parameters />
+      <Docs>
+        <summary>To be added.</summary>
+        <returns>To be added.</returns>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="Value">
+      <MemberSignature Language="C#" Value="public object Value { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Object</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+  </Members>
+</Type>
diff --git a/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/PropertyInfoMirror.xml b/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/PropertyInfoMirror.xml
new file mode 100644
index 0000000..62a31c6
--- /dev/null
+++ b/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/PropertyInfoMirror.xml
@@ -0,0 +1,243 @@
+<Type Name="PropertyInfoMirror" FullName="Mono.Debugger.Soft.PropertyInfoMirror">
+  <TypeSignature Language="C#" Value="public class PropertyInfoMirror : Mono.Debugger.Soft.Mirror" />
+  <AssemblyInfo>
+    <AssemblyName>Mono.Debugger.Soft</AssemblyName>
+    <AssemblyVersion>0.0.0.0</AssemblyVersion>
+  </AssemblyInfo>
+  <Base>
+    <BaseTypeName>Mono.Debugger.Soft.Mirror</BaseTypeName>
+  </Base>
+  <Interfaces />
+  <Docs>
+    <summary>To be added.</summary>
+    <remarks>To be added.</remarks>
+  </Docs>
+  <Members>
+    <Member MemberName=".ctor">
+      <MemberSignature Language="C#" Value="public PropertyInfoMirror (Mono.Debugger.Soft.TypeMirror parent, long id, string name, Mono.Debugger.Soft.MethodMirror get_method, Mono.Debugger.Soft.MethodMirror set_method, System.Reflection.PropertyAttributes attrs);" />
+      <MemberType>Constructor</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <Parameters>
+        <Parameter Name="parent" Type="Mono.Debugger.Soft.TypeMirror" />
+        <Parameter Name="id" Type="System.Int64" />
+        <Parameter Name="name" Type="System.String" />
+        <Parameter Name="get_method" Type="Mono.Debugger.Soft.MethodMirror" />
+        <Parameter Name="set_method" Type="Mono.Debugger.Soft.MethodMirror" />
+        <Parameter Name="attrs" Type="System.Reflection.PropertyAttributes" />
+      </Parameters>
+      <Docs>
+        <param name="parent">To be added.</param>
+        <param name="id">To be added.</param>
+        <param name="name">To be added.</param>
+        <param name="get_method">To be added.</param>
+        <param name="set_method">To be added.</param>
+        <param name="attrs">To be added.</param>
+        <summary>To be added.</summary>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="Attributes">
+      <MemberSignature Language="C#" Value="public System.Reflection.PropertyAttributes Attributes { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Reflection.PropertyAttributes</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="DeclaringType">
+      <MemberSignature Language="C#" Value="public Mono.Debugger.Soft.TypeMirror DeclaringType { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.TypeMirror</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="GetCustomAttributes">
+      <MemberSignature Language="C#" Value="public Mono.Debugger.Soft.CustomAttributeDataMirror[] GetCustomAttributes (bool inherit);" />
+      <MemberType>Method</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.CustomAttributeDataMirror[]</ReturnType>
+      </ReturnValue>
+      <Parameters>
+        <Parameter Name="inherit" Type="System.Boolean" />
+      </Parameters>
+      <Docs>
+        <param name="inherit">To be added.</param>
+        <summary>To be added.</summary>
+        <returns>To be added.</returns>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="GetCustomAttributes">
+      <MemberSignature Language="C#" Value="public Mono.Debugger.Soft.CustomAttributeDataMirror[] GetCustomAttributes (Mono.Debugger.Soft.TypeMirror attributeType, bool inherit);" />
+      <MemberType>Method</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.CustomAttributeDataMirror[]</ReturnType>
+      </ReturnValue>
+      <Parameters>
+        <Parameter Name="attributeType" Type="Mono.Debugger.Soft.TypeMirror" />
+        <Parameter Name="inherit" Type="System.Boolean" />
+      </Parameters>
+      <Docs>
+        <param name="attributeType">To be added.</param>
+        <param name="inherit">To be added.</param>
+        <summary>To be added.</summary>
+        <returns>To be added.</returns>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="GetGetMethod">
+      <MemberSignature Language="C#" Value="public Mono.Debugger.Soft.MethodMirror GetGetMethod ();" />
+      <MemberType>Method</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.MethodMirror</ReturnType>
+      </ReturnValue>
+      <Parameters />
+      <Docs>
+        <summary>To be added.</summary>
+        <returns>To be added.</returns>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="GetGetMethod">
+      <MemberSignature Language="C#" Value="public Mono.Debugger.Soft.MethodMirror GetGetMethod (bool nonPublic);" />
+      <MemberType>Method</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.MethodMirror</ReturnType>
+      </ReturnValue>
+      <Parameters>
+        <Parameter Name="nonPublic" Type="System.Boolean" />
+      </Parameters>
+      <Docs>
+        <param name="nonPublic">To be added.</param>
+        <summary>To be added.</summary>
+        <returns>To be added.</returns>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="GetIndexParameters">
+      <MemberSignature Language="C#" Value="public Mono.Debugger.Soft.ParameterInfoMirror[] GetIndexParameters ();" />
+      <MemberType>Method</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.ParameterInfoMirror[]</ReturnType>
+      </ReturnValue>
+      <Parameters />
+      <Docs>
+        <summary>To be added.</summary>
+        <returns>To be added.</returns>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="GetSetMethod">
+      <MemberSignature Language="C#" Value="public Mono.Debugger.Soft.MethodMirror GetSetMethod ();" />
+      <MemberType>Method</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.MethodMirror</ReturnType>
+      </ReturnValue>
+      <Parameters />
+      <Docs>
+        <summary>To be added.</summary>
+        <returns>To be added.</returns>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="GetSetMethod">
+      <MemberSignature Language="C#" Value="public Mono.Debugger.Soft.MethodMirror GetSetMethod (bool nonPublic);" />
+      <MemberType>Method</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.MethodMirror</ReturnType>
+      </ReturnValue>
+      <Parameters>
+        <Parameter Name="nonPublic" Type="System.Boolean" />
+      </Parameters>
+      <Docs>
+        <param name="nonPublic">To be added.</param>
+        <summary>To be added.</summary>
+        <returns>To be added.</returns>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="IsSpecialName">
+      <MemberSignature Language="C#" Value="public bool IsSpecialName { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Boolean</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="Name">
+      <MemberSignature Language="C#" Value="public string Name { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.String</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="PropertyType">
+      <MemberSignature Language="C#" Value="public Mono.Debugger.Soft.TypeMirror PropertyType { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.TypeMirror</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+  </Members>
+</Type>
diff --git a/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/StackFrame.xml b/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/StackFrame.xml
new file mode 100644
index 0000000..c29e98b
--- /dev/null
+++ b/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/StackFrame.xml
@@ -0,0 +1,254 @@
+<Type Name="StackFrame" FullName="Mono.Debugger.Soft.StackFrame">
+  <TypeSignature Language="C#" Value="public class StackFrame : Mono.Debugger.Soft.Mirror" />
+  <AssemblyInfo>
+    <AssemblyName>Mono.Debugger.Soft</AssemblyName>
+    <AssemblyVersion>0.0.0.0</AssemblyVersion>
+  </AssemblyInfo>
+  <Base>
+    <BaseTypeName>Mono.Debugger.Soft.Mirror</BaseTypeName>
+  </Base>
+  <Interfaces />
+  <Docs>
+    <summary>Represents a stack frame of a suspended thread in the debuggee.</summary>
+    <remarks>
+    </remarks>
+  </Docs>
+  <Members>
+    <Member MemberName="FileName">
+      <MemberSignature Language="C#" Value="public string FileName { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.String</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="GetArgument">
+      <MemberSignature Language="C#" Value="public Mono.Debugger.Soft.Value GetArgument (int pos);" />
+      <MemberType>Method</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.Value</ReturnType>
+      </ReturnValue>
+      <Parameters>
+        <Parameter Name="pos" Type="System.Int32" />
+      </Parameters>
+      <Docs>
+        <param name="pos">To be added.</param>
+        <summary>To be added.</summary>
+        <returns>To be added.</returns>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="GetThis">
+      <MemberSignature Language="C#" Value="public Mono.Debugger.Soft.Value GetThis ();" />
+      <MemberType>Method</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.Value</ReturnType>
+      </ReturnValue>
+      <Parameters />
+      <Docs>
+        <summary>To be added.</summary>
+        <returns>To be added.</returns>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="GetValue">
+      <MemberSignature Language="C#" Value="public Mono.Debugger.Soft.Value GetValue (Mono.Debugger.Soft.LocalVariable var);" />
+      <MemberType>Method</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.Value</ReturnType>
+      </ReturnValue>
+      <Parameters>
+        <Parameter Name="var" Type="Mono.Debugger.Soft.LocalVariable" />
+      </Parameters>
+      <Docs>
+        <param name="var">To be added.</param>
+        <summary>To be added.</summary>
+        <returns>To be added.</returns>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="GetValue">
+      <MemberSignature Language="C#" Value="public Mono.Debugger.Soft.Value GetValue (Mono.Debugger.Soft.ParameterInfoMirror param);" />
+      <MemberType>Method</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.Value</ReturnType>
+      </ReturnValue>
+      <Parameters>
+        <Parameter Name="param" Type="Mono.Debugger.Soft.ParameterInfoMirror" />
+      </Parameters>
+      <Docs>
+        <param name="param">To be added.</param>
+        <summary>To be added.</summary>
+        <returns>To be added.</returns>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="GetValues">
+      <MemberSignature Language="C#" Value="public Mono.Debugger.Soft.Value[] GetValues (Mono.Debugger.Soft.LocalVariable[] vars);" />
+      <MemberType>Method</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.Value[]</ReturnType>
+      </ReturnValue>
+      <Parameters>
+        <Parameter Name="vars" Type="Mono.Debugger.Soft.LocalVariable[]" />
+      </Parameters>
+      <Docs>
+        <param name="vars">To be added.</param>
+        <summary>To be added.</summary>
+        <returns>To be added.</returns>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="ILOffset">
+      <MemberSignature Language="C#" Value="public int ILOffset { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Int32</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="IsDebuggerInvoke">
+      <MemberSignature Language="C#" Value="public bool IsDebuggerInvoke { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Boolean</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>Returns whenever this stack frame represents the first frame of a method invocation done by the debugger itself using the InvokeMethod () methods.</summary>
+        <remarks>Not in JDI.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="LineNumber">
+      <MemberSignature Language="C#" Value="public int LineNumber { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Int32</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="Location">
+      <MemberSignature Language="C#" Value="public Mono.Debugger.Soft.Location Location { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.Location</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="Method">
+      <MemberSignature Language="C#" Value="public Mono.Debugger.Soft.MethodMirror Method { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.MethodMirror</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="SetValue">
+      <MemberSignature Language="C#" Value="public void SetValue (Mono.Debugger.Soft.LocalVariable var, Mono.Debugger.Soft.Value value);" />
+      <MemberType>Method</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Void</ReturnType>
+      </ReturnValue>
+      <Parameters>
+        <Parameter Name="var" Type="Mono.Debugger.Soft.LocalVariable" />
+        <Parameter Name="value" Type="Mono.Debugger.Soft.Value" />
+      </Parameters>
+      <Docs>
+        <param name="var">To be added.</param>
+        <param name="value">To be added.</param>
+        <summary>To be added.</summary>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="SetValue">
+      <MemberSignature Language="C#" Value="public void SetValue (Mono.Debugger.Soft.ParameterInfoMirror param, Mono.Debugger.Soft.Value value);" />
+      <MemberType>Method</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Void</ReturnType>
+      </ReturnValue>
+      <Parameters>
+        <Parameter Name="param" Type="Mono.Debugger.Soft.ParameterInfoMirror" />
+        <Parameter Name="value" Type="Mono.Debugger.Soft.Value" />
+      </Parameters>
+      <Docs>
+        <param name="param">To be added.</param>
+        <param name="value">To be added.</param>
+        <summary>To be added.</summary>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="Thread">
+      <MemberSignature Language="C#" Value="public Mono.Debugger.Soft.ThreadMirror Thread { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.ThreadMirror</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+  </Members>
+</Type>
diff --git a/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/StackFrameType.xml b/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/StackFrameType.xml
new file mode 100644
index 0000000..6603f69
--- /dev/null
+++ b/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/StackFrameType.xml
@@ -0,0 +1,42 @@
+<Type Name="StackFrameType" FullName="Mono.Debugger.Soft.StackFrameType">
+  <TypeSignature Language="C#" Value="public enum StackFrameType" />
+  <AssemblyInfo>
+    <AssemblyName>Mono.Debugger.Soft</AssemblyName>
+    <AssemblyVersion>0.0.0.0</AssemblyVersion>
+  </AssemblyInfo>
+  <Base>
+    <BaseTypeName>System.Enum</BaseTypeName>
+  </Base>
+  <Docs>
+    <summary>Represents the type of a stack frame.</summary>
+    <remarks>Not in JDI</remarks>
+  </Docs>
+  <Members>
+    <Member MemberName="DebuggerInvoke">
+      <MemberSignature Language="C#" Value="DebuggerInvoke" />
+      <MemberType>Field</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.StackFrameType</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>This is a pseudo stack frame marking the location in the stack where a method invocation started by the debugger itself begins.</summary>
+      </Docs>
+    </Member>
+    <Member MemberName="Normal">
+      <MemberSignature Language="C#" Value="Normal" />
+      <MemberType>Field</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.StackFrameType</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>The stack frame is for a normal managed method call.</summary>
+      </Docs>
+    </Member>
+  </Members>
+</Type>
diff --git a/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/StepDepth.xml b/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/StepDepth.xml
new file mode 100644
index 0000000..c8261eb
--- /dev/null
+++ b/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/StepDepth.xml
@@ -0,0 +1,56 @@
+<Type Name="StepDepth" FullName="Mono.Debugger.Soft.StepDepth">
+  <TypeSignature Language="C#" Value="public enum StepDepth" />
+  <AssemblyInfo>
+    <AssemblyName>Mono.Debugger.Soft</AssemblyName>
+    <AssemblyVersion>0.0.0.0</AssemblyVersion>
+  </AssemblyInfo>
+  <Base>
+    <BaseTypeName>System.Enum</BaseTypeName>
+  </Base>
+  <Docs>
+    <summary>Type of a Single Step operation.</summary>
+    <remarks>
+    </remarks>
+  </Docs>
+  <Members>
+    <Member MemberName="Into">
+      <MemberSignature Language="C#" Value="Into" />
+      <MemberType>Field</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.StepDepth</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+      </Docs>
+    </Member>
+    <Member MemberName="Out">
+      <MemberSignature Language="C#" Value="Out" />
+      <MemberType>Field</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.StepDepth</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+      </Docs>
+    </Member>
+    <Member MemberName="Over">
+      <MemberSignature Language="C#" Value="Over" />
+      <MemberType>Field</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.StepDepth</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+      </Docs>
+    </Member>
+  </Members>
+</Type>
diff --git a/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/StepEvent.xml b/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/StepEvent.xml
new file mode 100644
index 0000000..187b786
--- /dev/null
+++ b/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/StepEvent.xml
@@ -0,0 +1,48 @@
+<Type Name="StepEvent" FullName="Mono.Debugger.Soft.StepEvent">
+  <TypeSignature Language="C#" Value="public class StepEvent : Mono.Debugger.Soft.Event" />
+  <AssemblyInfo>
+    <AssemblyName>Mono.Debugger.Soft</AssemblyName>
+    <AssemblyVersion>0.0.0.0</AssemblyVersion>
+  </AssemblyInfo>
+  <Base>
+    <BaseTypeName>Mono.Debugger.Soft.Event</BaseTypeName>
+  </Base>
+  <Interfaces />
+  <Docs>
+    <summary>Sent when a Single Step event occurs in the debuggee.</summary>
+    <remarks>
+    </remarks>
+  </Docs>
+  <Members>
+    <Member MemberName="Location">
+      <MemberSignature Language="C#" Value="public long Location { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Int64</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="Method">
+      <MemberSignature Language="C#" Value="public Mono.Debugger.Soft.MethodMirror Method { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.MethodMirror</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+  </Members>
+</Type>
diff --git a/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/StepEventRequest.xml b/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/StepEventRequest.xml
new file mode 100644
index 0000000..1a7199a
--- /dev/null
+++ b/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/StepEventRequest.xml
@@ -0,0 +1,78 @@
+<Type Name="StepEventRequest" FullName="Mono.Debugger.Soft.StepEventRequest">
+  <TypeSignature Language="C#" Value="public sealed class StepEventRequest : Mono.Debugger.Soft.EventRequest" />
+  <AssemblyInfo>
+    <AssemblyName>Mono.Debugger.Soft</AssemblyName>
+    <AssemblyVersion>0.0.0.0</AssemblyVersion>
+  </AssemblyInfo>
+  <Base>
+    <BaseTypeName>Mono.Debugger.Soft.EventRequest</BaseTypeName>
+  </Base>
+  <Interfaces />
+  <Docs>
+    <summary>Request object for single step events.</summary>
+    <remarks>
+    </remarks>
+  </Docs>
+  <Members>
+    <Member MemberName="Depth">
+      <MemberSignature Language="C#" Value="public Mono.Debugger.Soft.StepDepth Depth { set; get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.StepDepth</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="Enable">
+      <MemberSignature Language="C#" Value="public override void Enable ();" />
+      <MemberType>Method</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Void</ReturnType>
+      </ReturnValue>
+      <Parameters />
+      <Docs>
+        <summary>To be added.</summary>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="Size">
+      <MemberSignature Language="C#" Value="public Mono.Debugger.Soft.StepSize Size { set; get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.StepSize</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="Thread">
+      <MemberSignature Language="C#" Value="public Mono.Debugger.Soft.ThreadMirror Thread { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.ThreadMirror</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+  </Members>
+</Type>
diff --git a/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/StepSize.xml b/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/StepSize.xml
new file mode 100644
index 0000000..41964ba
--- /dev/null
+++ b/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/StepSize.xml
@@ -0,0 +1,43 @@
+<Type Name="StepSize" FullName="Mono.Debugger.Soft.StepSize">
+  <TypeSignature Language="C#" Value="public enum StepSize" />
+  <AssemblyInfo>
+    <AssemblyName>Mono.Debugger.Soft</AssemblyName>
+    <AssemblyVersion>0.0.0.0</AssemblyVersion>
+  </AssemblyInfo>
+  <Base>
+    <BaseTypeName>System.Enum</BaseTypeName>
+  </Base>
+  <Docs>
+    <summary>Amount of code to execute when single stepping.</summary>
+    <remarks>
+    </remarks>
+  </Docs>
+  <Members>
+    <Member MemberName="Line">
+      <MemberSignature Language="C#" Value="Line" />
+      <MemberType>Field</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.StepSize</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+      </Docs>
+    </Member>
+    <Member MemberName="Min">
+      <MemberSignature Language="C#" Value="Min" />
+      <MemberType>Field</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.StepSize</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+      </Docs>
+    </Member>
+  </Members>
+</Type>
diff --git a/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/StringMirror.xml b/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/StringMirror.xml
new file mode 100644
index 0000000..ccb1ce3
--- /dev/null
+++ b/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/StringMirror.xml
@@ -0,0 +1,33 @@
+<Type Name="StringMirror" FullName="Mono.Debugger.Soft.StringMirror">
+  <TypeSignature Language="C#" Value="public class StringMirror : Mono.Debugger.Soft.ObjectMirror" />
+  <AssemblyInfo>
+    <AssemblyName>Mono.Debugger.Soft</AssemblyName>
+    <AssemblyVersion>0.0.0.0</AssemblyVersion>
+  </AssemblyInfo>
+  <Base>
+    <BaseTypeName>Mono.Debugger.Soft.ObjectMirror</BaseTypeName>
+  </Base>
+  <Interfaces />
+  <Docs>
+    <summary>Represents a string object in the debuggee.</summary>
+    <remarks>
+    </remarks>
+  </Docs>
+  <Members>
+    <Member MemberName="Value">
+      <MemberSignature Language="C#" Value="public string Value { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.String</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+  </Members>
+</Type>
diff --git a/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/StructMirror.xml b/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/StructMirror.xml
new file mode 100644
index 0000000..8ffe57a
--- /dev/null
+++ b/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/StructMirror.xml
@@ -0,0 +1,90 @@
+<Type Name="StructMirror" FullName="Mono.Debugger.Soft.StructMirror">
+  <TypeSignature Language="C#" Value="public class StructMirror : Mono.Debugger.Soft.Value" />
+  <AssemblyInfo>
+    <AssemblyName>Mono.Debugger.Soft</AssemblyName>
+    <AssemblyVersion>0.0.0.0</AssemblyVersion>
+  </AssemblyInfo>
+  <Base>
+    <BaseTypeName>Mono.Debugger.Soft.Value</BaseTypeName>
+  </Base>
+  <Interfaces />
+  <Docs>
+    <summary>Represents a valuetype instance in the debuggee.</summary>
+    <remarks>
+    </remarks>
+  </Docs>
+  <Members>
+    <Member MemberName="Fields">
+      <MemberSignature Language="C#" Value="public Mono.Debugger.Soft.Value[] Fields { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.Value[]</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="InvokeMethod">
+      <MemberSignature Language="C#" Value="public Mono.Debugger.Soft.Value InvokeMethod (Mono.Debugger.Soft.ThreadMirror thread, Mono.Debugger.Soft.MethodMirror method, System.Collections.Generic.IList<Mono.Debugger.Soft.Value> arguments);" />
+      <MemberType>Method</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.Value</ReturnType>
+      </ReturnValue>
+      <Parameters>
+        <Parameter Name="thread" Type="Mono.Debugger.Soft.ThreadMirror" />
+        <Parameter Name="method" Type="Mono.Debugger.Soft.MethodMirror" />
+        <Parameter Name="arguments" Type="System.Collections.Generic.IList<Mono.Debugger.Soft.Value>" />
+      </Parameters>
+      <Docs>
+        <param name="thread">To be added.</param>
+        <param name="method">To be added.</param>
+        <param name="arguments">To be added.</param>
+        <summary>To be added.</summary>
+        <returns>To be added.</returns>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="Item">
+      <MemberSignature Language="C#" Value="public Mono.Debugger.Soft.Value this[string field] { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.Value</ReturnType>
+      </ReturnValue>
+      <Parameters>
+        <Parameter Name="field" Type="System.String" />
+      </Parameters>
+      <Docs>
+        <param name="field">To be added.</param>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="Type">
+      <MemberSignature Language="C#" Value="public Mono.Debugger.Soft.TypeMirror Type { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.TypeMirror</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+  </Members>
+</Type>
diff --git a/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/SuspendPolicy.xml b/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/SuspendPolicy.xml
new file mode 100644
index 0000000..d68af57
--- /dev/null
+++ b/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/SuspendPolicy.xml
@@ -0,0 +1,56 @@
+<Type Name="SuspendPolicy" FullName="Mono.Debugger.Soft.SuspendPolicy">
+  <TypeSignature Language="C#" Value="public enum SuspendPolicy" />
+  <AssemblyInfo>
+    <AssemblyName>Mono.Debugger.Soft</AssemblyName>
+    <AssemblyVersion>0.0.0.0</AssemblyVersion>
+  </AssemblyInfo>
+  <Base>
+    <BaseTypeName>System.Enum</BaseTypeName>
+  </Base>
+  <Docs>
+    <summary>Determines which threads are suspended in the debuggee when an event occurs.</summary>
+    <remarks>
+    </remarks>
+  </Docs>
+  <Members>
+    <Member MemberName="All">
+      <MemberSignature Language="C#" Value="All" />
+      <MemberType>Field</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.SuspendPolicy</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+      </Docs>
+    </Member>
+    <Member MemberName="EventThread">
+      <MemberSignature Language="C#" Value="EventThread" />
+      <MemberType>Field</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.SuspendPolicy</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+      </Docs>
+    </Member>
+    <Member MemberName="None">
+      <MemberSignature Language="C#" Value="None" />
+      <MemberType>Field</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.SuspendPolicy</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+      </Docs>
+    </Member>
+  </Members>
+</Type>
diff --git a/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/ThreadDeathEvent.xml b/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/ThreadDeathEvent.xml
new file mode 100644
index 0000000..88b19a9
--- /dev/null
+++ b/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/ThreadDeathEvent.xml
@@ -0,0 +1,17 @@
+<Type Name="ThreadDeathEvent" FullName="Mono.Debugger.Soft.ThreadDeathEvent">
+  <TypeSignature Language="C#" Value="public class ThreadDeathEvent : Mono.Debugger.Soft.Event" />
+  <AssemblyInfo>
+    <AssemblyName>Mono.Debugger.Soft</AssemblyName>
+    <AssemblyVersion>0.0.0.0</AssemblyVersion>
+  </AssemblyInfo>
+  <Base>
+    <BaseTypeName>Mono.Debugger.Soft.Event</BaseTypeName>
+  </Base>
+  <Interfaces />
+  <Docs>
+    <summary>Sent when a ThreadDeath event occurs in the debuggee.</summary>
+    <remarks>
+    </remarks>
+  </Docs>
+  <Members />
+</Type>
diff --git a/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/ThreadMirror.xml b/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/ThreadMirror.xml
new file mode 100644
index 0000000..95697f9
--- /dev/null
+++ b/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/ThreadMirror.xml
@@ -0,0 +1,64 @@
+<Type Name="ThreadMirror" FullName="Mono.Debugger.Soft.ThreadMirror">
+  <TypeSignature Language="C#" Value="public class ThreadMirror : Mono.Debugger.Soft.ObjectMirror" />
+  <AssemblyInfo>
+    <AssemblyName>Mono.Debugger.Soft</AssemblyName>
+    <AssemblyVersion>0.0.0.0</AssemblyVersion>
+  </AssemblyInfo>
+  <Base>
+    <BaseTypeName>Mono.Debugger.Soft.ObjectMirror</BaseTypeName>
+  </Base>
+  <Interfaces />
+  <Docs>
+    <summary>Represents a Thread in the debuggee.</summary>
+    <remarks>
+    </remarks>
+  </Docs>
+  <Members>
+    <Member MemberName="GetFrames">
+      <MemberSignature Language="C#" Value="public Mono.Debugger.Soft.StackFrame[] GetFrames ();" />
+      <MemberType>Method</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.StackFrame[]</ReturnType>
+      </ReturnValue>
+      <Parameters />
+      <Docs>
+        <summary>To be added.</summary>
+        <returns>To be added.</returns>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="Id">
+      <MemberSignature Language="C#" Value="public long Id { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Int64</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="Name">
+      <MemberSignature Language="C#" Value="public string Name { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.String</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+  </Members>
+</Type>
diff --git a/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/ThreadStartEvent.xml b/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/ThreadStartEvent.xml
new file mode 100644
index 0000000..265ab41
--- /dev/null
+++ b/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/ThreadStartEvent.xml
@@ -0,0 +1,17 @@
+<Type Name="ThreadStartEvent" FullName="Mono.Debugger.Soft.ThreadStartEvent">
+  <TypeSignature Language="C#" Value="public class ThreadStartEvent : Mono.Debugger.Soft.Event" />
+  <AssemblyInfo>
+    <AssemblyName>Mono.Debugger.Soft</AssemblyName>
+    <AssemblyVersion>0.0.0.0</AssemblyVersion>
+  </AssemblyInfo>
+  <Base>
+    <BaseTypeName>Mono.Debugger.Soft.Event</BaseTypeName>
+  </Base>
+  <Interfaces />
+  <Docs>
+    <summary>Sent when a ThreadStart event occurs in the debuggee.</summary>
+    <remarks>
+    </remarks>
+  </Docs>
+  <Members />
+</Type>
diff --git a/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/TypeLoadEvent.xml b/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/TypeLoadEvent.xml
new file mode 100644
index 0000000..8295b43
--- /dev/null
+++ b/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/TypeLoadEvent.xml
@@ -0,0 +1,33 @@
+<Type Name="TypeLoadEvent" FullName="Mono.Debugger.Soft.TypeLoadEvent">
+  <TypeSignature Language="C#" Value="public class TypeLoadEvent : Mono.Debugger.Soft.Event" />
+  <AssemblyInfo>
+    <AssemblyName>Mono.Debugger.Soft</AssemblyName>
+    <AssemblyVersion>0.0.0.0</AssemblyVersion>
+  </AssemblyInfo>
+  <Base>
+    <BaseTypeName>Mono.Debugger.Soft.Event</BaseTypeName>
+  </Base>
+  <Interfaces />
+  <Docs>
+    <summary>Sent when a TypeLoad event occurs in the debuggee.</summary>
+    <remarks>
+    </remarks>
+  </Docs>
+  <Members>
+    <Member MemberName="Type">
+      <MemberSignature Language="C#" Value="public Mono.Debugger.Soft.TypeMirror Type { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.TypeMirror</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+  </Members>
+</Type>
diff --git a/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/TypeMirror.xml b/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/TypeMirror.xml
new file mode 100644
index 0000000..0c52165
--- /dev/null
+++ b/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/TypeMirror.xml
@@ -0,0 +1,1199 @@
+<Type Name="TypeMirror" FullName="Mono.Debugger.Soft.TypeMirror">
+  <TypeSignature Language="C#" Value="public class TypeMirror : Mono.Debugger.Soft.Mirror" />
+  <AssemblyInfo>
+    <AssemblyName>Mono.Debugger.Soft</AssemblyName>
+    <AssemblyVersion>0.0.0.0</AssemblyVersion>
+  </AssemblyInfo>
+  <Base>
+    <BaseTypeName>Mono.Debugger.Soft.Mirror</BaseTypeName>
+  </Base>
+  <Interfaces />
+  <Docs>
+    <summary>Represents a Type in the debuggee.</summary>
+    <remarks>
+    </remarks>
+  </Docs>
+  <Members>
+    <Member MemberName="Assembly">
+      <MemberSignature Language="C#" Value="public Mono.Debugger.Soft.AssemblyMirror Assembly { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.AssemblyMirror</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="Attributes">
+      <MemberSignature Language="C#" Value="public System.Reflection.TypeAttributes Attributes { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Reflection.TypeAttributes</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="BaseType">
+      <MemberSignature Language="C#" Value="public Mono.Debugger.Soft.TypeMirror BaseType { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.TypeMirror</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="CSharpName">
+      <MemberSignature Language="C#" Value="public string CSharpName { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.String</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="FullName">
+      <MemberSignature Language="C#" Value="public string FullName { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.String</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="GetArrayRank">
+      <MemberSignature Language="C#" Value="public int GetArrayRank ();" />
+      <MemberType>Method</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Int32</ReturnType>
+      </ReturnValue>
+      <Parameters />
+      <Docs>
+        <summary>To be added.</summary>
+        <returns>To be added.</returns>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="GetAttributeFlagsImpl">
+      <MemberSignature Language="C#" Value="protected virtual System.Reflection.TypeAttributes GetAttributeFlagsImpl ();" />
+      <MemberType>Method</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Reflection.TypeAttributes</ReturnType>
+      </ReturnValue>
+      <Parameters />
+      <Docs>
+        <summary>To be added.</summary>
+        <returns>To be added.</returns>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="GetCustomAttributes">
+      <MemberSignature Language="C#" Value="public Mono.Debugger.Soft.CustomAttributeDataMirror[] GetCustomAttributes (bool inherit);" />
+      <MemberType>Method</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.CustomAttributeDataMirror[]</ReturnType>
+      </ReturnValue>
+      <Parameters>
+        <Parameter Name="inherit" Type="System.Boolean" />
+      </Parameters>
+      <Docs>
+        <param name="inherit">To be added.</param>
+        <summary>To be added.</summary>
+        <returns>To be added.</returns>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="GetCustomAttributes">
+      <MemberSignature Language="C#" Value="public Mono.Debugger.Soft.CustomAttributeDataMirror[] GetCustomAttributes (Mono.Debugger.Soft.TypeMirror attributeType, bool inherit);" />
+      <MemberType>Method</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.CustomAttributeDataMirror[]</ReturnType>
+      </ReturnValue>
+      <Parameters>
+        <Parameter Name="attributeType" Type="Mono.Debugger.Soft.TypeMirror" />
+        <Parameter Name="inherit" Type="System.Boolean" />
+      </Parameters>
+      <Docs>
+        <param name="attributeType">To be added.</param>
+        <param name="inherit">To be added.</param>
+        <summary>To be added.</summary>
+        <returns>To be added.</returns>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="GetElementType">
+      <MemberSignature Language="C#" Value="public Mono.Debugger.Soft.TypeMirror GetElementType ();" />
+      <MemberType>Method</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.TypeMirror</ReturnType>
+      </ReturnValue>
+      <Parameters />
+      <Docs>
+        <summary>To be added.</summary>
+        <returns>To be added.</returns>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="GetField">
+      <MemberSignature Language="C#" Value="public Mono.Debugger.Soft.FieldInfoMirror GetField (string name);" />
+      <MemberType>Method</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.FieldInfoMirror</ReturnType>
+      </ReturnValue>
+      <Parameters>
+        <Parameter Name="name" Type="System.String" />
+      </Parameters>
+      <Docs>
+        <param name="name">To be added.</param>
+        <summary>To be added.</summary>
+        <returns>To be added.</returns>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="GetFields">
+      <MemberSignature Language="C#" Value="public Mono.Debugger.Soft.FieldInfoMirror[] GetFields ();" />
+      <MemberType>Method</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.FieldInfoMirror[]</ReturnType>
+      </ReturnValue>
+      <Parameters />
+      <Docs>
+        <summary>To be added.</summary>
+        <returns>To be added.</returns>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="GetMethod">
+      <MemberSignature Language="C#" Value="public Mono.Debugger.Soft.MethodMirror GetMethod (string name);" />
+      <MemberType>Method</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.MethodMirror</ReturnType>
+      </ReturnValue>
+      <Parameters>
+        <Parameter Name="name" Type="System.String" />
+      </Parameters>
+      <Docs>
+        <param name="name">To be added.</param>
+        <summary>To be added.</summary>
+        <returns>To be added.</returns>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="GetMethods">
+      <MemberSignature Language="C#" Value="public Mono.Debugger.Soft.MethodMirror[] GetMethods ();" />
+      <MemberType>Method</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.MethodMirror[]</ReturnType>
+      </ReturnValue>
+      <Parameters />
+      <Docs>
+        <summary>To be added.</summary>
+        <returns>To be added.</returns>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="GetNestedTypes">
+      <MemberSignature Language="C#" Value="public Mono.Debugger.Soft.TypeMirror[] GetNestedTypes ();" />
+      <MemberType>Method</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.TypeMirror[]</ReturnType>
+      </ReturnValue>
+      <Parameters />
+      <Docs>
+        <summary>To be added.</summary>
+        <returns>To be added.</returns>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="GetNestedTypes">
+      <MemberSignature Language="C#" Value="public Mono.Debugger.Soft.TypeMirror[] GetNestedTypes (System.Reflection.BindingFlags bindingAttr);" />
+      <MemberType>Method</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.TypeMirror[]</ReturnType>
+      </ReturnValue>
+      <Parameters>
+        <Parameter Name="bindingAttr" Type="System.Reflection.BindingFlags" />
+      </Parameters>
+      <Docs>
+        <param name="bindingAttr">To be added.</param>
+        <summary>To be added.</summary>
+        <returns>To be added.</returns>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="GetProperties">
+      <MemberSignature Language="C#" Value="public Mono.Debugger.Soft.PropertyInfoMirror[] GetProperties ();" />
+      <MemberType>Method</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.PropertyInfoMirror[]</ReturnType>
+      </ReturnValue>
+      <Parameters />
+      <Docs>
+        <summary>To be added.</summary>
+        <returns>To be added.</returns>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="GetProperties">
+      <MemberSignature Language="C#" Value="public Mono.Debugger.Soft.PropertyInfoMirror[] GetProperties (System.Reflection.BindingFlags bindingAttr);" />
+      <MemberType>Method</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.PropertyInfoMirror[]</ReturnType>
+      </ReturnValue>
+      <Parameters>
+        <Parameter Name="bindingAttr" Type="System.Reflection.BindingFlags" />
+      </Parameters>
+      <Docs>
+        <param name="bindingAttr">To be added.</param>
+        <summary>To be added.</summary>
+        <returns>To be added.</returns>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="GetProperty">
+      <MemberSignature Language="C#" Value="public Mono.Debugger.Soft.PropertyInfoMirror GetProperty (string name);" />
+      <MemberType>Method</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.PropertyInfoMirror</ReturnType>
+      </ReturnValue>
+      <Parameters>
+        <Parameter Name="name" Type="System.String" />
+      </Parameters>
+      <Docs>
+        <param name="name">To be added.</param>
+        <summary>To be added.</summary>
+        <returns>To be added.</returns>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="GetSourceFiles">
+      <MemberSignature Language="C#" Value="public string[] GetSourceFiles ();" />
+      <MemberType>Method</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.String[]</ReturnType>
+      </ReturnValue>
+      <Parameters />
+      <Docs>
+        <summary>To be added.</summary>
+        <returns>To be added.</returns>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="GetTypeObject">
+      <MemberSignature Language="C#" Value="public Mono.Debugger.Soft.ObjectMirror GetTypeObject ();" />
+      <MemberType>Method</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.ObjectMirror</ReturnType>
+      </ReturnValue>
+      <Parameters />
+      <Docs>
+        <summary>To be added.</summary>
+        <returns>To be added.</returns>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="GetValue">
+      <MemberSignature Language="C#" Value="public Mono.Debugger.Soft.Value GetValue (Mono.Debugger.Soft.FieldInfoMirror field);" />
+      <MemberType>Method</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.Value</ReturnType>
+      </ReturnValue>
+      <Parameters>
+        <Parameter Name="field" Type="Mono.Debugger.Soft.FieldInfoMirror" />
+      </Parameters>
+      <Docs>
+        <param name="field">To be added.</param>
+        <summary>To be added.</summary>
+        <returns>To be added.</returns>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="GetValues">
+      <MemberSignature Language="C#" Value="public Mono.Debugger.Soft.Value[] GetValues (System.Collections.Generic.IList<Mono.Debugger.Soft.FieldInfoMirror> fields);" />
+      <MemberType>Method</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.Value[]</ReturnType>
+      </ReturnValue>
+      <Parameters>
+        <Parameter Name="fields" Type="System.Collections.Generic.IList<Mono.Debugger.Soft.FieldInfoMirror>" />
+      </Parameters>
+      <Docs>
+        <param name="fields">To be added.</param>
+        <summary>To be added.</summary>
+        <returns>To be added.</returns>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="HasElementType">
+      <MemberSignature Language="C#" Value="public bool HasElementType { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Boolean</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="HasElementTypeImpl">
+      <MemberSignature Language="C#" Value="protected virtual bool HasElementTypeImpl ();" />
+      <MemberType>Method</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Boolean</ReturnType>
+      </ReturnValue>
+      <Parameters />
+      <Docs>
+        <summary>To be added.</summary>
+        <returns>To be added.</returns>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="InvokeMethod">
+      <MemberSignature Language="C#" Value="public Mono.Debugger.Soft.Value InvokeMethod (Mono.Debugger.Soft.ThreadMirror thread, Mono.Debugger.Soft.MethodMirror method, System.Collections.Generic.IList<Mono.Debugger.Soft.Value> arguments);" />
+      <MemberType>Method</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.Value</ReturnType>
+      </ReturnValue>
+      <Parameters>
+        <Parameter Name="thread" Type="Mono.Debugger.Soft.ThreadMirror" />
+        <Parameter Name="method" Type="Mono.Debugger.Soft.MethodMirror" />
+        <Parameter Name="arguments" Type="System.Collections.Generic.IList<Mono.Debugger.Soft.Value>" />
+      </Parameters>
+      <Docs>
+        <param name="thread">To be added.</param>
+        <param name="method">To be added.</param>
+        <param name="arguments">To be added.</param>
+        <summary>To be added.</summary>
+        <returns>To be added.</returns>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="IsAbstract">
+      <MemberSignature Language="C#" Value="public bool IsAbstract { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Boolean</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="IsAnsiClass">
+      <MemberSignature Language="C#" Value="public bool IsAnsiClass { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Boolean</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="IsArray">
+      <MemberSignature Language="C#" Value="public bool IsArray { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Boolean</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="IsArrayImpl">
+      <MemberSignature Language="C#" Value="protected virtual bool IsArrayImpl ();" />
+      <MemberType>Method</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Boolean</ReturnType>
+      </ReturnValue>
+      <Parameters />
+      <Docs>
+        <summary>To be added.</summary>
+        <returns>To be added.</returns>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="IsAssignableFrom">
+      <MemberSignature Language="C#" Value="public virtual bool IsAssignableFrom (Mono.Debugger.Soft.TypeMirror c);" />
+      <MemberType>Method</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Boolean</ReturnType>
+      </ReturnValue>
+      <Parameters>
+        <Parameter Name="c" Type="Mono.Debugger.Soft.TypeMirror" />
+      </Parameters>
+      <Docs>
+        <param name="c">To be added.</param>
+        <summary>To be added.</summary>
+        <returns>To be added.</returns>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="IsAutoClass">
+      <MemberSignature Language="C#" Value="public bool IsAutoClass { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Boolean</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="IsAutoLayout">
+      <MemberSignature Language="C#" Value="public bool IsAutoLayout { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Boolean</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="IsByRef">
+      <MemberSignature Language="C#" Value="public bool IsByRef { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Boolean</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="IsByRefImpl">
+      <MemberSignature Language="C#" Value="protected virtual bool IsByRefImpl ();" />
+      <MemberType>Method</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Boolean</ReturnType>
+      </ReturnValue>
+      <Parameters />
+      <Docs>
+        <summary>To be added.</summary>
+        <returns>To be added.</returns>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="IsClass">
+      <MemberSignature Language="C#" Value="public bool IsClass { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Boolean</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="IsCOMObject">
+      <MemberSignature Language="C#" Value="public bool IsCOMObject { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Boolean</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="IsCOMObjectImpl">
+      <MemberSignature Language="C#" Value="protected virtual bool IsCOMObjectImpl ();" />
+      <MemberType>Method</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Boolean</ReturnType>
+      </ReturnValue>
+      <Parameters />
+      <Docs>
+        <summary>To be added.</summary>
+        <returns>To be added.</returns>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="IsContextful">
+      <MemberSignature Language="C#" Value="public bool IsContextful { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Boolean</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="IsContextfulImpl">
+      <MemberSignature Language="C#" Value="protected virtual bool IsContextfulImpl ();" />
+      <MemberType>Method</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Boolean</ReturnType>
+      </ReturnValue>
+      <Parameters />
+      <Docs>
+        <summary>To be added.</summary>
+        <returns>To be added.</returns>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="IsEnum">
+      <MemberSignature Language="C#" Value="public bool IsEnum { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Boolean</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="IsExplicitLayout">
+      <MemberSignature Language="C#" Value="public bool IsExplicitLayout { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Boolean</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="IsImport">
+      <MemberSignature Language="C#" Value="public bool IsImport { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Boolean</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="IsInterface">
+      <MemberSignature Language="C#" Value="public bool IsInterface { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Boolean</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="IsLayoutSequential">
+      <MemberSignature Language="C#" Value="public bool IsLayoutSequential { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Boolean</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="IsMarshalByRef">
+      <MemberSignature Language="C#" Value="public bool IsMarshalByRef { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Boolean</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="IsMarshalByRefImpl">
+      <MemberSignature Language="C#" Value="protected virtual bool IsMarshalByRefImpl ();" />
+      <MemberType>Method</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Boolean</ReturnType>
+      </ReturnValue>
+      <Parameters />
+      <Docs>
+        <summary>To be added.</summary>
+        <returns>To be added.</returns>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="IsNestedAssembly">
+      <MemberSignature Language="C#" Value="public bool IsNestedAssembly { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Boolean</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="IsNestedFamANDAssem">
+      <MemberSignature Language="C#" Value="public bool IsNestedFamANDAssem { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Boolean</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="IsNestedFamily">
+      <MemberSignature Language="C#" Value="public bool IsNestedFamily { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Boolean</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="IsNestedFamORAssem">
+      <MemberSignature Language="C#" Value="public bool IsNestedFamORAssem { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Boolean</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="IsNestedPrivate">
+      <MemberSignature Language="C#" Value="public bool IsNestedPrivate { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Boolean</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="IsNestedPublic">
+      <MemberSignature Language="C#" Value="public bool IsNestedPublic { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Boolean</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="IsNotPublic">
+      <MemberSignature Language="C#" Value="public bool IsNotPublic { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Boolean</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="IsPointer">
+      <MemberSignature Language="C#" Value="public bool IsPointer { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Boolean</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="IsPointerImpl">
+      <MemberSignature Language="C#" Value="protected virtual bool IsPointerImpl ();" />
+      <MemberType>Method</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Boolean</ReturnType>
+      </ReturnValue>
+      <Parameters />
+      <Docs>
+        <summary>To be added.</summary>
+        <returns>To be added.</returns>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="IsPrimitive">
+      <MemberSignature Language="C#" Value="public bool IsPrimitive { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Boolean</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="IsPrimitiveImpl">
+      <MemberSignature Language="C#" Value="protected virtual bool IsPrimitiveImpl ();" />
+      <MemberType>Method</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Boolean</ReturnType>
+      </ReturnValue>
+      <Parameters />
+      <Docs>
+        <summary>To be added.</summary>
+        <returns>To be added.</returns>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="IsPublic">
+      <MemberSignature Language="C#" Value="public bool IsPublic { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Boolean</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="IsSealed">
+      <MemberSignature Language="C#" Value="public bool IsSealed { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Boolean</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="IsSerializable">
+      <MemberSignature Language="C#" Value="public bool IsSerializable { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Boolean</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="IsSpecialName">
+      <MemberSignature Language="C#" Value="public bool IsSpecialName { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Boolean</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="IsUnicodeClass">
+      <MemberSignature Language="C#" Value="public bool IsUnicodeClass { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Boolean</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="IsValueType">
+      <MemberSignature Language="C#" Value="public bool IsValueType { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Boolean</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="IsValueTypeImpl">
+      <MemberSignature Language="C#" Value="protected virtual bool IsValueTypeImpl ();" />
+      <MemberType>Method</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Boolean</ReturnType>
+      </ReturnValue>
+      <Parameters />
+      <Docs>
+        <summary>To be added.</summary>
+        <returns>To be added.</returns>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="Metadata">
+      <MemberSignature Language="C#" Value="public Mono.Cecil.TypeDefinition Metadata { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Cecil.TypeDefinition</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="MetadataToken">
+      <MemberSignature Language="C#" Value="public int MetadataToken { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Int32</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="Module">
+      <MemberSignature Language="C#" Value="public Mono.Debugger.Soft.ModuleMirror Module { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.ModuleMirror</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="Name">
+      <MemberSignature Language="C#" Value="public string Name { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.String</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="Namespace">
+      <MemberSignature Language="C#" Value="public string Namespace { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.String</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="NewInstance">
+      <MemberSignature Language="C#" Value="public Mono.Debugger.Soft.Value NewInstance (Mono.Debugger.Soft.ThreadMirror thread, Mono.Debugger.Soft.MethodMirror method, System.Collections.Generic.IList<Mono.Debugger.Soft.Value> arguments);" />
+      <MemberType>Method</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.Value</ReturnType>
+      </ReturnValue>
+      <Parameters>
+        <Parameter Name="thread" Type="Mono.Debugger.Soft.ThreadMirror" />
+        <Parameter Name="method" Type="Mono.Debugger.Soft.MethodMirror" />
+        <Parameter Name="arguments" Type="System.Collections.Generic.IList<Mono.Debugger.Soft.Value>" />
+      </Parameters>
+      <Docs>
+        <param name="thread">To be added.</param>
+        <param name="method">To be added.</param>
+        <param name="arguments">To be added.</param>
+        <summary>To be added.</summary>
+        <returns>To be added.</returns>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="SetValue">
+      <MemberSignature Language="C#" Value="public void SetValue (Mono.Debugger.Soft.FieldInfoMirror field, Mono.Debugger.Soft.Value value);" />
+      <MemberType>Method</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Void</ReturnType>
+      </ReturnValue>
+      <Parameters>
+        <Parameter Name="field" Type="Mono.Debugger.Soft.FieldInfoMirror" />
+        <Parameter Name="value" Type="Mono.Debugger.Soft.Value" />
+      </Parameters>
+      <Docs>
+        <param name="field">To be added.</param>
+        <param name="value">To be added.</param>
+        <summary>To be added.</summary>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="SetValues">
+      <MemberSignature Language="C#" Value="public void SetValues (System.Collections.Generic.IList<Mono.Debugger.Soft.FieldInfoMirror> fields, Mono.Debugger.Soft.Value[] values);" />
+      <MemberType>Method</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Void</ReturnType>
+      </ReturnValue>
+      <Parameters>
+        <Parameter Name="fields" Type="System.Collections.Generic.IList<Mono.Debugger.Soft.FieldInfoMirror>" />
+        <Parameter Name="values" Type="Mono.Debugger.Soft.Value[]" />
+      </Parameters>
+      <Docs>
+        <param name="fields">To be added.</param>
+        <param name="values">To be added.</param>
+        <summary>To be added.</summary>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+  </Members>
+</Type>
diff --git a/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/VMDeathEvent.xml b/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/VMDeathEvent.xml
new file mode 100644
index 0000000..3b498d0
--- /dev/null
+++ b/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/VMDeathEvent.xml
@@ -0,0 +1,35 @@
+<Type Name="VMDeathEvent" FullName="Mono.Debugger.Soft.VMDeathEvent">
+  <TypeSignature Language="C#" Value="public class VMDeathEvent : Mono.Debugger.Soft.Event" />
+  <AssemblyInfo>
+    <AssemblyName>Mono.Debugger.Soft</AssemblyName>
+    <AssemblyVersion>0.0.0.0</AssemblyVersion>
+  </AssemblyInfo>
+  <Base>
+    <BaseTypeName>Mono.Debugger.Soft.Event</BaseTypeName>
+  </Base>
+  <Interfaces />
+  <Docs>
+    <summary>Sent when a VMDeath event occurs in the debuggee.</summary>
+    <remarks>
+    </remarks>
+  </Docs>
+  <Members>
+    <Member MemberName=".ctor">
+      <MemberSignature Language="C#" Value="public VMDeathEvent (Mono.Debugger.Soft.VirtualMachine vm, int req_id);" />
+      <MemberType>Constructor</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <Parameters>
+        <Parameter Name="vm" Type="Mono.Debugger.Soft.VirtualMachine" />
+        <Parameter Name="req_id" Type="System.Int32" />
+      </Parameters>
+      <Docs>
+        <param name="vm">To be added.</param>
+        <param name="req_id">To be added.</param>
+        <summary>To be added.</summary>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+  </Members>
+</Type>
diff --git a/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/VMDisconnectEvent.xml b/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/VMDisconnectEvent.xml
new file mode 100644
index 0000000..b078dfa
--- /dev/null
+++ b/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/VMDisconnectEvent.xml
@@ -0,0 +1,35 @@
+<Type Name="VMDisconnectEvent" FullName="Mono.Debugger.Soft.VMDisconnectEvent">
+  <TypeSignature Language="C#" Value="public class VMDisconnectEvent : Mono.Debugger.Soft.Event" />
+  <AssemblyInfo>
+    <AssemblyName>Mono.Debugger.Soft</AssemblyName>
+    <AssemblyVersion>0.0.0.0</AssemblyVersion>
+  </AssemblyInfo>
+  <Base>
+    <BaseTypeName>Mono.Debugger.Soft.Event</BaseTypeName>
+  </Base>
+  <Interfaces />
+  <Docs>
+    <summary>Sent when the connection to the debuggee is lost.</summary>
+    <remarks>
+    </remarks>
+  </Docs>
+  <Members>
+    <Member MemberName=".ctor">
+      <MemberSignature Language="C#" Value="public VMDisconnectEvent (Mono.Debugger.Soft.VirtualMachine vm, int req_id);" />
+      <MemberType>Constructor</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <Parameters>
+        <Parameter Name="vm" Type="Mono.Debugger.Soft.VirtualMachine" />
+        <Parameter Name="req_id" Type="System.Int32" />
+      </Parameters>
+      <Docs>
+        <param name="vm">To be added.</param>
+        <param name="req_id">To be added.</param>
+        <summary>To be added.</summary>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+  </Members>
+</Type>
diff --git a/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/VMDisconnectedException.xml b/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/VMDisconnectedException.xml
new file mode 100644
index 0000000..f2b5920
--- /dev/null
+++ b/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/VMDisconnectedException.xml
@@ -0,0 +1,30 @@
+<Type Name="VMDisconnectedException" FullName="Mono.Debugger.Soft.VMDisconnectedException">
+  <TypeSignature Language="C#" Value="public class VMDisconnectedException : Exception" />
+  <AssemblyInfo>
+    <AssemblyName>Mono.Debugger.Soft</AssemblyName>
+    <AssemblyVersion>0.0.0.0</AssemblyVersion>
+  </AssemblyInfo>
+  <Base>
+    <BaseTypeName>System.Exception</BaseTypeName>
+  </Base>
+  <Interfaces />
+  <Docs>
+    <summary>Thrown when the connection to the debuggee is lost while executing an operation.</summary>
+    <remarks>
+    </remarks>
+  </Docs>
+  <Members>
+    <Member MemberName=".ctor">
+      <MemberSignature Language="C#" Value="public VMDisconnectedException ();" />
+      <MemberType>Constructor</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <Parameters />
+      <Docs>
+        <summary>To be added.</summary>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+  </Members>
+</Type>
diff --git a/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/VMMismatchException.xml b/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/VMMismatchException.xml
new file mode 100644
index 0000000..3b28939
--- /dev/null
+++ b/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/VMMismatchException.xml
@@ -0,0 +1,30 @@
+<Type Name="VMMismatchException" FullName="Mono.Debugger.Soft.VMMismatchException">
+  <TypeSignature Language="C#" Value="public class VMMismatchException : Exception" />
+  <AssemblyInfo>
+    <AssemblyName>Mono.Debugger.Soft</AssemblyName>
+    <AssemblyVersion>0.0.0.0</AssemblyVersion>
+  </AssemblyInfo>
+  <Base>
+    <BaseTypeName>System.Exception</BaseTypeName>
+  </Base>
+  <Interfaces />
+  <Docs>
+    <summary>Thrown when an attempt was made to use entities belonging to different virtual machines.</summary>
+    <remarks>
+    </remarks>
+  </Docs>
+  <Members>
+    <Member MemberName=".ctor">
+      <MemberSignature Language="C#" Value="public VMMismatchException ();" />
+      <MemberType>Constructor</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <Parameters />
+      <Docs>
+        <summary>To be added.</summary>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+  </Members>
+</Type>
diff --git a/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/VMStartEvent.xml b/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/VMStartEvent.xml
new file mode 100644
index 0000000..c3b9e3b
--- /dev/null
+++ b/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/VMStartEvent.xml
@@ -0,0 +1,37 @@
+<Type Name="VMStartEvent" FullName="Mono.Debugger.Soft.VMStartEvent">
+  <TypeSignature Language="C#" Value="public class VMStartEvent : Mono.Debugger.Soft.Event" />
+  <AssemblyInfo>
+    <AssemblyName>Mono.Debugger.Soft</AssemblyName>
+    <AssemblyVersion>0.0.0.0</AssemblyVersion>
+  </AssemblyInfo>
+  <Base>
+    <BaseTypeName>Mono.Debugger.Soft.Event</BaseTypeName>
+  </Base>
+  <Interfaces />
+  <Docs>
+    <summary>Sent when a VMStart event occurs in the debuggee.</summary>
+    <remarks>
+    </remarks>
+  </Docs>
+  <Members>
+    <Member MemberName=".ctor">
+      <MemberSignature Language="C#" Value="public VMStartEvent (Mono.Debugger.Soft.VirtualMachine vm, int req_id, long thread_id);" />
+      <MemberType>Constructor</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <Parameters>
+        <Parameter Name="vm" Type="Mono.Debugger.Soft.VirtualMachine" />
+        <Parameter Name="req_id" Type="System.Int32" />
+        <Parameter Name="thread_id" Type="System.Int64" />
+      </Parameters>
+      <Docs>
+        <param name="vm">To be added.</param>
+        <param name="req_id">To be added.</param>
+        <param name="thread_id">To be added.</param>
+        <summary>To be added.</summary>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+  </Members>
+</Type>
diff --git a/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/Value.xml b/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/Value.xml
new file mode 100644
index 0000000..48556ab
--- /dev/null
+++ b/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/Value.xml
@@ -0,0 +1,17 @@
+<Type Name="Value" FullName="Mono.Debugger.Soft.Value">
+  <TypeSignature Language="C#" Value="public abstract class Value : Mono.Debugger.Soft.Mirror" />
+  <AssemblyInfo>
+    <AssemblyName>Mono.Debugger.Soft</AssemblyName>
+    <AssemblyVersion>0.0.0.0</AssemblyVersion>
+  </AssemblyInfo>
+  <Base>
+    <BaseTypeName>Mono.Debugger.Soft.Mirror</BaseTypeName>
+  </Base>
+  <Interfaces />
+  <Docs>
+    <summary>Represents a value in the debuggee.</summary>
+    <remarks>
+    </remarks>
+  </Docs>
+  <Members />
+</Type>
diff --git a/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/VirtualMachine.xml b/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/VirtualMachine.xml
new file mode 100644
index 0000000..d55240b
--- /dev/null
+++ b/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/VirtualMachine.xml
@@ -0,0 +1,402 @@
+<Type Name="VirtualMachine" FullName="Mono.Debugger.Soft.VirtualMachine">
+  <TypeSignature Language="C#" Value="public class VirtualMachine : Mono.Debugger.Soft.Mirror" />
+  <AssemblyInfo>
+    <AssemblyName>Mono.Debugger.Soft</AssemblyName>
+    <AssemblyVersion>0.0.0.0</AssemblyVersion>
+  </AssemblyInfo>
+  <Base>
+    <BaseTypeName>Mono.Debugger.Soft.Mirror</BaseTypeName>
+  </Base>
+  <Interfaces />
+  <Docs>
+    <summary>Represents a connection to a debuggee.</summary>
+    <remarks>
+      <format type="text/html">
+        <a href="http://java.sun.com/j2se/1.5.0/docs/guide/jpda/jdi/com/sun/jdi/VirtualMachine.html">JDI Documentation</a>
+      </format>
+    </remarks>
+  </Docs>
+  <Members>
+    <Member MemberName="ClearAllBreakpoints">
+      <MemberSignature Language="C#" Value="public void ClearAllBreakpoints ();" />
+      <MemberType>Method</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Void</ReturnType>
+      </ReturnValue>
+      <Parameters />
+      <Docs>
+        <summary>To be added.</summary>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="CreateBreakpointRequest">
+      <MemberSignature Language="C#" Value="public Mono.Debugger.Soft.BreakpointEventRequest CreateBreakpointRequest (Mono.Debugger.Soft.MethodMirror method, long il_offset);" />
+      <MemberType>Method</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.BreakpointEventRequest</ReturnType>
+      </ReturnValue>
+      <Parameters>
+        <Parameter Name="method" Type="Mono.Debugger.Soft.MethodMirror" />
+        <Parameter Name="il_offset" Type="System.Int64" />
+      </Parameters>
+      <Docs>
+        <param name="method">
+        </param>
+        <param name="il_offset">To be added.</param>
+        <param name="location">
+        </param>
+        <summary>To be added.</summary>
+        <returns>To be added.</returns>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="CreateMethodEntryRequest">
+      <MemberSignature Language="C#" Value="public Mono.Debugger.Soft.MethodEntryEventRequest CreateMethodEntryRequest ();" />
+      <MemberType>Method</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.MethodEntryEventRequest</ReturnType>
+      </ReturnValue>
+      <Parameters />
+      <Docs>
+        <summary>To be added.</summary>
+        <returns>To be added.</returns>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="CreateMethodExitRequest">
+      <MemberSignature Language="C#" Value="public Mono.Debugger.Soft.MethodExitEventRequest CreateMethodExitRequest ();" />
+      <MemberType>Method</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.MethodExitEventRequest</ReturnType>
+      </ReturnValue>
+      <Parameters />
+      <Docs>
+        <summary>
+        </summary>
+        <returns>
+        </returns>
+        <remarks>
+        </remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="CreateStepRequest">
+      <MemberSignature Language="C#" Value="public Mono.Debugger.Soft.StepEventRequest CreateStepRequest (Mono.Debugger.Soft.ThreadMirror thread);" />
+      <MemberType>Method</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.StepEventRequest</ReturnType>
+      </ReturnValue>
+      <Parameters>
+        <Parameter Name="thread" Type="Mono.Debugger.Soft.ThreadMirror" />
+      </Parameters>
+      <Docs>
+        <param name="thread">
+        </param>
+        <summary>
+        </summary>
+        <returns>
+        </returns>
+        <remarks>
+        </remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="CreateValue">
+      <MemberSignature Language="C#" Value="public Mono.Debugger.Soft.PrimitiveValue CreateValue (object value);" />
+      <MemberType>Method</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.PrimitiveValue</ReturnType>
+      </ReturnValue>
+      <Parameters>
+        <Parameter Name="value" Type="System.Object" />
+      </Parameters>
+      <Docs>
+        <param name="value">To be added.</param>
+        <summary>To be added.</summary>
+        <returns>To be added.</returns>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="Dispose">
+      <MemberSignature Language="C#" Value="public void Dispose ();" />
+      <MemberType>Method</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Void</ReturnType>
+      </ReturnValue>
+      <Parameters />
+      <Docs>
+        <summary>
+        </summary>
+        <remarks>
+        </remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="EnableEvents">
+      <MemberSignature Language="C#" Value="public void EnableEvents (Mono.Debugger.Soft.EventType[] events);" />
+      <MemberType>Method</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Void</ReturnType>
+      </ReturnValue>
+      <Parameters>
+        <Parameter Name="events" Type="Mono.Debugger.Soft.EventType[]">
+          <Attributes>
+            <Attribute>
+              <AttributeName>System.ParamArray</AttributeName>
+            </Attribute>
+          </Attributes>
+        </Parameter>
+      </Parameters>
+      <Docs>
+        <param name="events">
+        </param>
+        <summary>
+        </summary>
+        <remarks>
+        </remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="EndPoint">
+      <MemberSignature Language="C#" Value="public System.Net.EndPoint EndPoint { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Net.EndPoint</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>
+        </summary>
+        <value>
+        </value>
+        <remarks>
+        </remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="Exit">
+      <MemberSignature Language="C#" Value="public void Exit (int exitCode);" />
+      <MemberType>Method</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Void</ReturnType>
+      </ReturnValue>
+      <Parameters>
+        <Parameter Name="exitCode" Type="System.Int32" />
+      </Parameters>
+      <Docs>
+        <param name="exitCode">
+        </param>
+        <summary>
+        </summary>
+        <remarks>
+        </remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="GetNextEvent">
+      <MemberSignature Language="C#" Value="public Mono.Debugger.Soft.Event GetNextEvent ();" />
+      <MemberType>Method</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.Event</ReturnType>
+      </ReturnValue>
+      <Parameters />
+      <Docs>
+        <summary>
+        </summary>
+        <returns>
+        </returns>
+        <remarks>
+        </remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="GetNextEvent">
+      <MemberSignature Language="C#" Value="public Mono.Debugger.Soft.Event GetNextEvent (int timeout);" />
+      <MemberType>Method</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.Event</ReturnType>
+      </ReturnValue>
+      <Parameters>
+        <Parameter Name="timeout" Type="System.Int32" />
+      </Parameters>
+      <Docs>
+        <param name="timeout">
+        </param>
+        <summary>
+        </summary>
+        <returns>
+        </returns>
+        <remarks>
+        </remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="GetNextEvent<T>">
+      <MemberSignature Language="C#" Value="public T GetNextEvent<T> () where T : Mono.Debugger.Soft.Event;" />
+      <MemberType>Method</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>T</ReturnType>
+      </ReturnValue>
+      <TypeParameters>
+        <TypeParameter Name="T">
+          <Constraints>
+            <BaseTypeName>Mono.Debugger.Soft.Event</BaseTypeName>
+          </Constraints>
+        </TypeParameter>
+      </TypeParameters>
+      <Parameters />
+      <Docs>
+        <typeparam name="T">
+        </typeparam>
+        <summary>
+        </summary>
+        <returns>
+        </returns>
+        <remarks>
+        </remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="GetThreads">
+      <MemberSignature Language="C#" Value="public System.Collections.Generic.IList<Mono.Debugger.Soft.ThreadMirror> GetThreads ();" />
+      <MemberType>Method</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Collections.Generic.IList<Mono.Debugger.Soft.ThreadMirror></ReturnType>
+      </ReturnValue>
+      <Parameters />
+      <Docs>
+        <summary>To be added.</summary>
+        <returns>To be added.</returns>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="Process">
+      <MemberSignature Language="C#" Value="public System.Diagnostics.Process Process { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Diagnostics.Process</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>
+        </summary>
+        <value>
+        </value>
+        <remarks>
+        </remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="Resume">
+      <MemberSignature Language="C#" Value="public void Resume ();" />
+      <MemberType>Method</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Void</ReturnType>
+      </ReturnValue>
+      <Parameters />
+      <Docs>
+        <summary>
+        </summary>
+        <remarks>
+        </remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="RootDomain">
+      <MemberSignature Language="C#" Value="public Mono.Debugger.Soft.AppDomainMirror RootDomain { get; }" />
+      <MemberType>Property</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.AppDomainMirror</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>
+        </summary>
+        <value>
+        </value>
+        <remarks>
+        </remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="SetBreakpoint">
+      <MemberSignature Language="C#" Value="public Mono.Debugger.Soft.BreakpointEventRequest SetBreakpoint (Mono.Debugger.Soft.MethodMirror method, long il_offset);" />
+      <MemberType>Method</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.BreakpointEventRequest</ReturnType>
+      </ReturnValue>
+      <Parameters>
+        <Parameter Name="method" Type="Mono.Debugger.Soft.MethodMirror" />
+        <Parameter Name="il_offset" Type="System.Int64" />
+      </Parameters>
+      <Docs>
+        <param name="method">
+        </param>
+        <param name="il_offset">
+        </param>
+        <summary>
+        </summary>
+        <returns>
+        </returns>
+        <remarks>
+        </remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="Suspend">
+      <MemberSignature Language="C#" Value="public void Suspend ();" />
+      <MemberType>Method</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>System.Void</ReturnType>
+      </ReturnValue>
+      <Parameters />
+      <Docs>
+        <summary>
+        </summary>
+        <remarks>
+        </remarks>
+      </Docs>
+    </Member>
+  </Members>
+</Type>
diff --git a/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/VirtualMachineManager.xml b/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/VirtualMachineManager.xml
new file mode 100644
index 0000000..ffe8c9a
--- /dev/null
+++ b/mcs/class/Mono.Debugger.Soft/Documentation/en/Mono.Debugger.Soft/VirtualMachineManager.xml
@@ -0,0 +1,57 @@
+<Type Name="VirtualMachineManager" FullName="Mono.Debugger.Soft.VirtualMachineManager">
+  <TypeSignature Language="C#" Value="public class VirtualMachineManager" />
+  <AssemblyInfo>
+    <AssemblyName>Mono.Debugger.Soft</AssemblyName>
+    <AssemblyVersion>0.0.0.0</AssemblyVersion>
+  </AssemblyInfo>
+  <Base>
+    <BaseTypeName>System.Object</BaseTypeName>
+  </Base>
+  <Interfaces />
+  <Docs>
+    <summary>Allows launching and connecting to mono virtual machines.</summary>
+    <remarks>This class implements the functionality of the classes in the <format type="text/html"><a href="http://java.sun.com/j2se/1.5.0/docs/guide/jpda/jdi/com/sun/jdi/connect/package-frame.html">com.sun.kdi.connect</a></format> package in JDI.</remarks>
+  </Docs>
+  <Members>
+    <Member MemberName="Launch">
+      <MemberSignature Language="C#" Value="public static Mono.Debugger.Soft.VirtualMachine Launch (string[] args, Mono.Debugger.Soft.LaunchOptions options);" />
+      <MemberType>Method</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.VirtualMachine</ReturnType>
+      </ReturnValue>
+      <Parameters>
+        <Parameter Name="args" Type="System.String[]" />
+        <Parameter Name="options" Type="Mono.Debugger.Soft.LaunchOptions" />
+      </Parameters>
+      <Docs>
+        <param name="args">The arguments to pass to the launched virtual machine.</param>
+        <param name="options">Launch options.</param>
+        <summary>Launch a new virtual machine with the provided arguments.</summary>
+        <returns>To be added.</returns>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="Listen">
+      <MemberSignature Language="C#" Value="public static Mono.Debugger.Soft.VirtualMachine Listen (System.Net.IPEndPoint endpoint);" />
+      <MemberType>Method</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.Debugger.Soft.VirtualMachine</ReturnType>
+      </ReturnValue>
+      <Parameters>
+        <Parameter Name="endpoint" Type="System.Net.IPEndPoint" />
+      </Parameters>
+      <Docs>
+        <param name="endpoint">The TCP/IP endpoint to listen at.</param>
+        <summary>Wait for a virtual machine to connect at the specified address.</summary>
+        <returns>To be added.</returns>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+  </Members>
+</Type>
diff --git a/mcs/class/Mono.Debugger.Soft/Documentation/en/index.xml b/mcs/class/Mono.Debugger.Soft/Documentation/en/index.xml
new file mode 100644
index 0000000..0e514e8
--- /dev/null
+++ b/mcs/class/Mono.Debugger.Soft/Documentation/en/index.xml
@@ -0,0 +1,75 @@
+<Overview>
+  <Assemblies>
+    <Assembly Name="Mono.Debugger" Version="0.0.0.0">
+      <Attributes>
+        <Attribute>
+          <AttributeName>System.Runtime.CompilerServices.RuntimeCompatibility(WrapNonExceptionThrows=true)</AttributeName>
+        </Attribute>
+      </Attributes>
+    </Assembly>
+  </Assemblies>
+  <Copyright>(C) 2009 Novell, Inc.</Copyright>
+  <Types>
+    <Namespace Name="Mono.Debugger.Soft">
+      <Type Name="AppDomainMirror" Kind="Class" />
+      <Type Name="ArrayMirror" Kind="Class" />
+      <Type Name="AssemblyLoadEvent" Kind="Class" />
+      <Type Name="AssemblyMirror" Kind="Class" />
+      <Type Name="BreakpointEvent" Kind="Class" />
+      <Type Name="BreakpointEventRequest" Kind="Class" />
+      <Type Name="CustomAttributeDataMirror" Kind="Class" />
+      <Type Name="CustomAttributeNamedArgumentMirror" Kind="Structure" />
+      <Type Name="CustomAttributeTypedArgumentMirror" Kind="Structure" />
+      <Type Name="EnumMirror" Kind="Class" />
+      <Type Name="ErrorCode" Kind="Enumeration" />
+      <Type Name="ErrorHandlerEventArgs" Kind="Class" />
+      <Type Name="Event" Kind="Class" />
+      <Type Name="EventRequest" Kind="Class" />
+      <Type Name="EventType" Kind="Enumeration" />
+      <Type Name="FieldInfoMirror" Kind="Class" />
+      <Type Name="ILInstruction" Kind="Class" />
+      <Type Name="IMirror" Kind="Interface" />
+      <Type Name="InvalidStackFrameException" Kind="Class" />
+      <Type Name="InvocationException" Kind="Class" />
+      <Type Name="LaunchOptions" Kind="Class" />
+      <Type Name="LocalVariable" Kind="Class" />
+      <Type Name="Location" Kind="Class" />
+      <Type Name="MethodBodyMirror" Kind="Class" />
+      <Type Name="MethodEntryEvent" Kind="Class" />
+      <Type Name="MethodEntryEventRequest" Kind="Class" />
+      <Type Name="MethodExitEvent" Kind="Class" />
+      <Type Name="MethodExitEventRequest" Kind="Class" />
+      <Type Name="MethodMirror" Kind="Class" />
+      <Type Name="Mirror" Kind="Class" />
+      <Type Name="ModuleMirror" Kind="Class" />
+      <Type Name="ObjectCollectedException" Kind="Class" />
+      <Type Name="ObjectMirror" Kind="Class" />
+      <Type Name="ParameterInfoMirror" Kind="Class" />
+      <Type Name="PrimitiveValue" Kind="Class" />
+      <Type Name="PropertyInfoMirror" Kind="Class" />
+      <Type Name="StackFrame" Kind="Class" />
+      <Type Name="StackFrameType" Kind="Enumeration" />
+      <Type Name="StepDepth" Kind="Enumeration" />
+      <Type Name="StepEvent" Kind="Class" />
+      <Type Name="StepEventRequest" Kind="Class" />
+      <Type Name="StepSize" Kind="Enumeration" />
+      <Type Name="StringMirror" Kind="Class" />
+      <Type Name="StructMirror" Kind="Class" />
+      <Type Name="SuspendPolicy" Kind="Enumeration" />
+      <Type Name="ThreadDeathEvent" Kind="Class" />
+      <Type Name="ThreadMirror" Kind="Class" />
+      <Type Name="ThreadStartEvent" Kind="Class" />
+      <Type Name="TypeLoadEvent" Kind="Class" />
+      <Type Name="TypeMirror" Kind="Class" />
+      <Type Name="Value" Kind="Class" />
+      <Type Name="VirtualMachine" Kind="Class" />
+      <Type Name="VirtualMachineManager" Kind="Class" />
+      <Type Name="VMDeathEvent" Kind="Class" />
+      <Type Name="VMDisconnectedException" Kind="Class" />
+      <Type Name="VMDisconnectEvent" Kind="Class" />
+      <Type Name="VMMismatchException" Kind="Class" />
+      <Type Name="VMStartEvent" Kind="Class" />
+    </Namespace>
+  </Types>
+  <Title>Mono.Debugger</Title>
+</Overview>
diff --git a/mcs/class/Mono.Debugger.Soft/Documentation/en/ns-Mono.Debugger.Soft.xml b/mcs/class/Mono.Debugger.Soft/Documentation/en/ns-Mono.Debugger.Soft.xml
new file mode 100644
index 0000000..e658bfc
--- /dev/null
+++ b/mcs/class/Mono.Debugger.Soft/Documentation/en/ns-Mono.Debugger.Soft.xml
@@ -0,0 +1,18 @@
+<Namespace Name="Mono.Debugger">
+  <Docs>
+	<summary>Mono Soft Debugger API</summary>
+  <remarks>
+    <para>This API is used to communicate with the debugging agent running 
+	inside a mono runtime.
+	</para>
+    <para>The API is based on and is very similar to the <format type="text/html"><a href="http://java.sun.com/j2se/1.5.0/docs/guide/jpda/jdi/index.html">Java Debug Interface.</a> If documentation is missing, the JDI documentation can be consulted instead.</format></para>
+    <para>
+	In this documentation, debuggee refers to the remote process running the mono runtime which this API communicates with.
+	</para>
+    <para>A <c>Mirror</c> object represents an entity in the debuggee. There is usually one mirror subclass for each type of entity, i.e. <c>TypeMirror</c> for types, <c>AppDomainMirror</c> for application domains etc. These classes usually have a similar set of properties/methods as their non-mirror counterparts, the difference is that calling these properties/methods might result in a remote call to the debuggee to request information. The results of these remote calls are usually cached in the mirror object, so when multiple calls are made to <c>TypeMirror.Name</c>, for example, only the first call involves a remote operation. The <c>ToString()/Equals()/GetHashCode ()</c> methods are an exception, these are guaranteed to only access local state.
+	</para>
+    <para>Differences between this API and JDI:
+	<list type="bullet"><item><term>There is only one namespace, instead of 5 in JDI.</term></item><item><term>The API uses classes, while JDI uses interfaces.</term></item><item><term>No SPI interface yet.</term></item><item><term>Information is accessed using C# properties instead of methods.</term></item><item><term>There are fewer classes, i.e. <c>EventQueue</c>/<c>EventRequestManager</c> is integrated into <c>VirtualMachine</c>.</term></item><item><term>Values which have primitive types i.e. int are represented by a class called <c>PrimitiveValue</c>, instead of a separate class for each primitive type.</term></item></list></para>
+  </remarks>
+  </Docs>
+</Namespace>
diff --git a/mcs/class/Mono.Debugger.Soft/Makefile b/mcs/class/Mono.Debugger.Soft/Makefile
index 8cd47da..b07afb6 100644
--- a/mcs/class/Mono.Debugger.Soft/Makefile
+++ b/mcs/class/Mono.Debugger.Soft/Makefile
@@ -6,7 +6,16 @@ LIBRARY_SNK = ../mono.snk
 
 LIB_MCS_FLAGS = /r:$(corlib) /r:System.dll /r:Mono.Cecil.dll /r:System.Core.dll /unsafe -D:MONO_DATACONVERTER_STATIC_METHODS -keyfile:$(LIBRARY_SNK)
 
-NO_TEST = yes
+TEST_MCS_FLAGS = /r:Mono.Cecil.dll
+
+check: dtest-app.exe
+
+dtest-app.exe:
+	$(CSCOMPILE) -out:$@ -unsafe -debug Test/dtest-app.cs
+
+CLEAN_FILES = dtest-app.exe dtest-app.exe.mdb
+
+#NO_TEST = yes
 
 ifneq (net_2_0, $(PROFILE))
 NO_INSTALL = yes
diff --git a/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft.dll.sources b/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft.dll.sources
index c3920d3..df6a690 100644
--- a/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft.dll.sources
+++ b/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft.dll.sources
@@ -35,6 +35,7 @@ Mono.Debugger.Soft/MethodEntryEventRequest.cs
 Mono.Debugger.Soft/LocalVariable.cs
 Mono.Debugger.Soft/ParameterInfoMirror.cs
 Mono.Debugger.Soft/Event.cs
+Mono.Debugger.Soft/EventSet.cs
 Mono.Debugger.Soft/AppDomainCreateEvent.cs
 Mono.Debugger.Soft/ThreadDeathEvent.cs
 Mono.Debugger.Soft/SuspendPolicy.cs
@@ -59,3 +60,7 @@ Mono.Debugger.Soft/ThreadMirror.cs
 Mono.Debugger.Soft/TypeLoadEvent.cs
 Mono.Debugger.Soft/VMDisconnectEvent.cs
 Mono.Debugger.Soft/InvokeOptions.cs
+Mono.Debugger.Soft/IInvokeAsyncResult.cs
+Mono.Debugger.Soft/ITargetProcess.cs
+Mono.Debugger.Soft/AbsentInformationException.cs
+
diff --git a/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/AbsentInformationException.cs b/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/AbsentInformationException.cs
new file mode 100644
index 0000000..5ce9ee2
--- /dev/null
+++ b/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/AbsentInformationException.cs
@@ -0,0 +1,10 @@
+using System;
+
+namespace Mono.Debugger.Soft
+{
+	public class AbsentInformationException : Exception {
+		
+		public AbsentInformationException () : base ("Debug information is not available for this frame.") {
+		}
+	}
+}
diff --git a/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/ChangeLog b/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/ChangeLog
index 37fce59..7fc9d26 100644
--- a/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/ChangeLog
+++ b/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/ChangeLog
@@ -1,3 +1,69 @@
+2010-06-17  Zoltan Varga  <vargaz at gmail.com>
+
+	* VirtualMachine.cs Connection.cs: Group events received together into an EventSet,
+	like it is done in JDI. Add a GetNextEventSet () method.
+
+2010-06-04  Zoltan Varga  <vargaz at gmail.com>
+
+	* StackFrame.cs (GetVisibleVariables): New method to return the set of variables
+	visible at the current stack frame.
+
+2010-05-24  Martin Baulig  <martin at ximian.com>
+
+	* Connection.cs (VersionInfo): Make this public.
+
+	* VirtualMachine.cs (Version): New public property.
+
+2010-05-07  Zoltan Varga  <vargaz at gmail.com>
+
+	* VirtualMachine.cs (ErrorHandler): Convert ABSENT_INFORMATION to
+	AbsentInformationException.
+
+	* AbsentInformationException.cs: New file.
+
+2010-04-30  Zoltan Varga  <vargaz at gmail.com>
+
+	* TypeMirror.cs: Add new overload for GetSourceFiles () which returns full paths.
+
+2010-04-27  Lluis Sanchez  <lluis at novell.com>
+
+	* ITargetProcess.cs:
+	* VirtualMachine.cs:
+	* VirtualMachineManager.cs:
+	Restored old API. Renamed IProcess to ITargetProcess everywhere
+	to avoid naming conflicts.
+
+2010-04-26  Lluis Sanchez  <lluis at novell.com>
+
+	* IProcess.cs:
+	* VirtualMachine.cs:
+	* VirtualMachineManager.cs:
+	Added new IProcess interface which wraps the debugged process.
+	This abstraction makes it easier to support debugging processes
+	for which we don't have a direct Process reference (for example,
+	if the process is remote).
+
+2010-04-10  Zoltan Varga  <vargaz at gmail.com>
+
+	* ThreadMirror.cs: Add a ThreadId property.
+
+2010-03-05  Martin Baulig  <martin at ximian.com>
+
+	**** Backport of r153125 and r153336 ****
+
+	Add support for aborting invocations.
+
+	* IInvokeAsyncResult.cs: New file.
+	(IInvokeAsyncResult): New public interface; derives from
+	`IAsyncResult' and contains an Abort() method.
+
+	* Connection.cs
+	(Connection.VM_BeginInvokeMethod): Return the `id'.
+	(Connection.VM_AbortInvoke): New method.
+
+	* ObjectMirror.cs
+	(ObjectMirror.AbortInvoke): New internal static method.
+
 2010-03-01  Zoltan Varga  <vargaz at gmail.com>
 
 	* VirtualMachine.cs: Allow working with runtimes implementing a different
diff --git a/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/Connection.cs b/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/Connection.cs
index 40b3fd4..c6c378f 100644
--- a/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/Connection.cs
+++ b/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/Connection.cs
@@ -9,7 +9,7 @@ using Mono.Cecil.Metadata;
 
 namespace Mono.Debugger.Soft
 {
-	class VersionInfo {
+	public class VersionInfo {
 		public string VMVersion {
 			get; set;
 		}
@@ -193,6 +193,37 @@ namespace Mono.Debugger.Soft
 		}
 	}
 
+	class EventInfo {
+		public EventType EventType {
+			get; set;
+		}
+
+		public int ReqId {
+			get; set;
+		}
+
+		public SuspendPolicy SuspendPolicy {
+			get; set;
+		}
+
+		public long ThreadId {
+			get; set;
+		}
+
+		public long Id {
+			get; set;
+		}
+
+		public long Location {
+			get; set;
+		}
+
+		public EventInfo (EventType type, int req_id) {
+			EventType = type;
+			ReqId = req_id;
+		}
+	}
+
 	public enum ErrorCode {
 		NONE = 0,
 		INVALID_OBJECT = 20,
@@ -200,7 +231,10 @@ namespace Mono.Debugger.Soft
 		INVALID_FRAMEID = 30,
 		NOT_IMPLEMENTED = 100,
 		NOT_SUSPENDED = 101,
-		INVALID_ARGUMENT = 102
+		INVALID_ARGUMENT = 102,
+		ERR_UNLOADED = 103,
+		ERR_NO_INVOCATION = 104,
+		ABSENT_INFORMATION = 105
 	}
 
 	public class ErrorHandlerEventArgs : EventArgs {
@@ -289,7 +323,8 @@ namespace Mono.Debugger.Soft
 			EXIT = 5,
 			DISPOSE = 6,
 			INVOKE_METHOD = 7,
-			SET_PROTOCOL_VERSION = 8
+			SET_PROTOCOL_VERSION = 8,
+			ABORT_INVOKE = 9
 		}
 
 		enum CmdEvent {
@@ -300,7 +335,9 @@ namespace Mono.Debugger.Soft
 			GET_FRAME_INFO = 1,
 			GET_NAME = 2,
 			GET_STATE = 3,
-			GET_INFO = 4
+			GET_INFO = 4,
+			/* FIXME: Merge into GET_INFO when the major protocol version is increased */
+			GET_ID = 5
 		}
 
 		enum CmdEventRequest {
@@ -355,7 +392,9 @@ namespace Mono.Debugger.Soft
 			GET_PROPERTIES = 9,
 			GET_CATTRS = 10,
 			GET_FIELD_CATTRS = 11,
-			GET_PROPERTY_CATTRS = 12
+			GET_PROPERTY_CATTRS = 12,
+			/* FIXME: Merge into GET_SOURCE_FILES when the major protocol version is increased */
+			GET_SOURCE_FILES_2 = 13
 		}
 
 		enum CmdStackFrame {
@@ -971,71 +1010,93 @@ namespace Mono.Debugger.Soft
 					PacketReader r = new PacketReader (packet);
 
 					if (r.CommandSet == CommandSet.EVENT && r.Command == (int)CmdEvent.COMPOSITE) {
-						r.ReadByte (); // suspend_policy
+						int spolicy = r.ReadByte ();
 						int nevents = r.ReadInt ();
 
+						SuspendPolicy suspend_policy = decode_suspend_policy (spolicy);
+
+						EventInfo[] events = new EventInfo [nevents];
+
 						for (int i = 0; i < nevents; ++i) {
 							EventKind kind = (EventKind)r.ReadByte ();
 							int req_id = r.ReadInt ();
 
+							EventType etype = (EventType)kind;
+
 							if (kind == EventKind.VM_START) {
 								long thread_id = r.ReadId ();
-								EventHandler.VMStart (req_id, thread_id, null);
+								events [i] = new EventInfo (etype, req_id) { ThreadId = thread_id };
+								//EventHandler.VMStart (req_id, thread_id, null);
 							} else if (kind == EventKind.VM_DEATH) {
-								EventHandler.VMDeath (req_id, 0, null);
+								//EventHandler.VMDeath (req_id, 0, null);
+								events [i] = new EventInfo (etype, req_id) { };
 							} else if (kind == EventKind.THREAD_START) {
 								long thread_id = r.ReadId ();
-								EventHandler.ThreadStart (req_id, thread_id, thread_id);
+								events [i] = new EventInfo (etype, req_id) { ThreadId = thread_id, Id = thread_id };
+								//EventHandler.ThreadStart (req_id, thread_id, thread_id);
 							} else if (kind == EventKind.THREAD_DEATH) {
 								long thread_id = r.ReadId ();
-								EventHandler.ThreadDeath (req_id, thread_id, thread_id);
+								events [i] = new EventInfo (etype, req_id) { ThreadId = thread_id, Id = thread_id };
+								//EventHandler.ThreadDeath (req_id, thread_id, thread_id);
 							} else if (kind == EventKind.ASSEMBLY_LOAD) {
 								long thread_id = r.ReadId ();
 								long id = r.ReadId ();
-								EventHandler.AssemblyLoad (req_id, thread_id, id);
+								events [i] = new EventInfo (etype, req_id) { ThreadId = thread_id, Id = id };
+								//EventHandler.AssemblyLoad (req_id, thread_id, id);
 							} else if (kind == EventKind.ASSEMBLY_UNLOAD) {
 								long thread_id = r.ReadId ();
 								long id = r.ReadId ();
-								EventHandler.AssemblyUnload (req_id, thread_id, id);
+								events [i] = new EventInfo (etype, req_id) { ThreadId = thread_id, Id = id };
+								//EventHandler.AssemblyUnload (req_id, thread_id, id);
 							} else if (kind == EventKind.TYPE_LOAD) {
 								long thread_id = r.ReadId ();
 								long id = r.ReadId ();
-								EventHandler.TypeLoad (req_id, thread_id, id);
+								events [i] = new EventInfo (etype, req_id) { ThreadId = thread_id, Id = id };
+								//EventHandler.TypeLoad (req_id, thread_id, id);
 							} else if (kind == EventKind.METHOD_ENTRY) {
 								long thread_id = r.ReadId ();
 								long id = r.ReadId ();
-								EventHandler.MethodEntry (req_id, thread_id, id);
+								events [i] = new EventInfo (etype, req_id) { ThreadId = thread_id, Id = id };
+								//EventHandler.MethodEntry (req_id, thread_id, id);
 							} else if (kind == EventKind.METHOD_EXIT) {
 								long thread_id = r.ReadId ();
 								long id = r.ReadId ();
-								EventHandler.MethodExit (req_id, thread_id, id);
+								events [i] = new EventInfo (etype, req_id) { ThreadId = thread_id, Id = id };
+								//EventHandler.MethodExit (req_id, thread_id, id);
 							} else if (kind == EventKind.BREAKPOINT) {
 								long thread_id = r.ReadId ();
 								long id = r.ReadId ();
 								long loc = r.ReadLong ();
-								EventHandler.Breakpoint (req_id, thread_id, id, loc);
+								events [i] = new EventInfo (etype, req_id) { ThreadId = thread_id, Id = id, Location = loc };
+								//EventHandler.Breakpoint (req_id, thread_id, id, loc);
 							} else if (kind == EventKind.STEP) {
 								long thread_id = r.ReadId ();
 								long id = r.ReadId ();
 								long loc = r.ReadLong ();
-								EventHandler.Step (req_id, thread_id, id, loc);
+								events [i] = new EventInfo (etype, req_id) { ThreadId = thread_id, Id = id, Location = loc };
+								//EventHandler.Step (req_id, thread_id, id, loc);
 							} else if (kind == EventKind.EXCEPTION) {
 								long thread_id = r.ReadId ();
 								long id = r.ReadId ();
 								long loc = 0; // FIXME
-								EventHandler.Exception (req_id, thread_id, id, loc);
+								events [i] = new EventInfo (etype, req_id) { ThreadId = thread_id, Id = id, Location = loc };
+								//EventHandler.Exception (req_id, thread_id, id, loc);
 							} else if (kind == EventKind.APPDOMAIN_CREATE) {
 								long thread_id = r.ReadId ();
 								long id = r.ReadId ();
-								EventHandler.AppDomainCreate (req_id, thread_id, id);
+								events [i] = new EventInfo (etype, req_id) { ThreadId = thread_id, Id = id };
+								//EventHandler.AppDomainCreate (req_id, thread_id, id);
 							} else if (kind == EventKind.APPDOMAIN_UNLOAD) {
 								long thread_id = r.ReadId ();
 								long id = r.ReadId ();
-								EventHandler.AppDomainUnload (req_id, thread_id, id);
+								events [i] = new EventInfo (etype, req_id) { ThreadId = thread_id, Id = id };
+								//EventHandler.AppDomainUnload (req_id, thread_id, id);
 							} else {
 								throw new NotImplementedException ("Unknown event kind: " + kind);
 							}
 						}
+
+						EventHandler.Events (suspend_policy, events);
 					}
 				}
 
@@ -1047,7 +1108,7 @@ namespace Mono.Debugger.Soft
 		}
 
 		/* Send a request and call cb when a result is received */
-		void Send (CommandSet command_set, int command, PacketWriter packet, Action<PacketReader> cb) {
+		int Send (CommandSet command_set, int command, PacketWriter packet, Action<PacketReader> cb) {
 			int id = IdGenerator;
 
 			lock (reply_packets_monitor) {
@@ -1062,6 +1123,8 @@ namespace Mono.Debugger.Soft
 				WritePacket (EncodePacket (id, (int)command_set, command, null, 0));
 			else
 				WritePacket (EncodePacket (id, (int)command_set, command, packet.Data, packet.Offset));
+
+			return id;
 		}
 
 		PacketReader SendReceive (CommandSet command_set, int command, PacketWriter packet) {
@@ -1218,8 +1281,8 @@ namespace Mono.Debugger.Soft
 
 		public delegate void InvokeMethodCallback (ValueImpl v, ValueImpl exc, ErrorCode error, object state);
 
-		public void VM_BeginInvokeMethod (long thread, long method, ValueImpl this_arg, ValueImpl[] arguments, InvokeFlags flags, InvokeMethodCallback callback, object state) {
-			Send (CommandSet.VM, (int)CmdVM.INVOKE_METHOD, new PacketWriter ().WriteId (thread).WriteInt ((int)flags).WriteId (method).WriteValue (this_arg).WriteInt (arguments.Length).WriteValues (arguments), delegate (PacketReader r) {
+		public int VM_BeginInvokeMethod (long thread, long method, ValueImpl this_arg, ValueImpl[] arguments, InvokeFlags flags, InvokeMethodCallback callback, object state) {
+			return Send (CommandSet.VM, (int)CmdVM.INVOKE_METHOD, new PacketWriter ().WriteId (thread).WriteInt ((int)flags).WriteId (method).WriteValue (this_arg).WriteInt (arguments.Length).WriteValues (arguments), delegate (PacketReader r) {
 					ValueImpl v, exc;
 
 					if (r.ErrorCode != 0) {
@@ -1238,6 +1301,11 @@ namespace Mono.Debugger.Soft
 				});
 		}
 
+		public void VM_AbortInvoke (long thread, int id)
+		{
+			SendReceive (CommandSet.VM, (int)CmdVM.ABORT_INVOKE, new PacketWriter ().WriteId (thread).WriteInt (id));
+		}
+
 		/*
 		 * DOMAIN
 		 */
@@ -1420,6 +1488,10 @@ namespace Mono.Debugger.Soft
 			return res;
 		}
 
+		public long Thread_GetId (long id) {
+			return SendReceive (CommandSet.THREAD, (int)CmdThread.GET_ID, new PacketWriter ().WriteId (id)).ReadLong ();
+		}
+
 		/*
 		 * MODULE
 		 */
@@ -1553,8 +1625,8 @@ namespace Mono.Debugger.Soft
 			SendReceive (CommandSet.TYPE, (int)CmdType.SET_VALUES, new PacketWriter ().WriteId (id).WriteInt (fields.Length).WriteIds (fields).WriteValues (values));
 		}
 
-		public string[] Type_GetSourceFiles (long id) {
-			var r = SendReceive (CommandSet.TYPE, (int)CmdType.GET_SOURCE_FILES, new PacketWriter ().WriteId (id));
+		public string[] Type_GetSourceFiles (long id, bool return_full_paths) {
+			var r = SendReceive (CommandSet.TYPE, return_full_paths ? (int)CmdType.GET_SOURCE_FILES_2 : (int)CmdType.GET_SOURCE_FILES, new PacketWriter ().WriteId (id));
 			int len = r.ReadInt ();
 			string[] res = new string [len];
 			for (int i = 0; i < len; ++i)
@@ -1741,34 +1813,8 @@ namespace Mono.Debugger.Soft
 	/* This is the interface exposed by the debugger towards the debugger agent */
 	interface IEventHandler
 	{
-		void VMStart (int req_id, long thread_id, string vm_uri);
-
-		void VMDeath (int req_id, long thread_id, string vm_uri);
+		void Events (SuspendPolicy suspend_policy, EventInfo[] events);
 
 		void VMDisconnect (int req_id, long thread_id, string vm_uri);
-
-		void ThreadStart (int req_id, long thread_id, long id);
-
-		void ThreadDeath (int req_id, long thread_id, long id);
-
-		void AssemblyLoad (int req_id, long thread_id, long id);
-
-		void AssemblyUnload (int req_id, long thread_id, long id);
-
-		void TypeLoad (int req_id, long thread_id, long id);
-
-		void MethodEntry (int req_id, long thread_id, long id);
-
-		void MethodExit (int req_id, long thread_id, long id);
-
-		void Breakpoint (int req_id, long thread_id, long method_id, long loc);
-
-		void Step (int req_id, long thread_id, long method_id, long loc);
-
-		void Exception (int req_id, long thread_id, long exc_id, long loc);
-
-		void AppDomainCreate (int req_id, long thread_id, long id);
-
-		void AppDomainUnload (int req_id, long thread_id, long id);
 	}
 }
diff --git a/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/EventSet.cs b/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/EventSet.cs
new file mode 100644
index 0000000..cc83be5
--- /dev/null
+++ b/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/EventSet.cs
@@ -0,0 +1,34 @@
+using System;
+
+namespace Mono.Debugger.Soft
+{
+	public class EventSet {
+		protected VirtualMachine vm;
+		SuspendPolicy suspend_policy;
+		Event[] events;
+
+		internal EventSet (VirtualMachine vm, SuspendPolicy suspend_policy, Event[] events) {
+			this.vm = vm;
+			this.suspend_policy = suspend_policy;
+			this.events = events;
+		}
+
+		public SuspendPolicy SuspendPolicy {
+			get {
+				return suspend_policy;
+			}
+		}
+
+		public Event[] Events {
+			get {
+				return events;
+			}
+		}
+
+		public Event this [int index] {
+			get {
+				return Events [index];
+			}
+		}
+	}
+}
diff --git a/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/IInvokeAsyncResult.cs b/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/IInvokeAsyncResult.cs
new file mode 100644
index 0000000..19b0ae7
--- /dev/null
+++ b/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/IInvokeAsyncResult.cs
@@ -0,0 +1,10 @@
+using System;
+using System.Collections.Generic;
+
+namespace Mono.Debugger.Soft
+{
+	public interface IInvokeAsyncResult : IAsyncResult
+	{
+		void Abort ();
+	}
+}
diff --git a/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/ITargetProcess.cs b/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/ITargetProcess.cs
new file mode 100644
index 0000000..3a29e35
--- /dev/null
+++ b/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/ITargetProcess.cs
@@ -0,0 +1,74 @@
+using System;
+using System.Diagnostics;
+using System.IO;
+
+namespace Mono.Debugger.Soft
+{
+	public interface ITargetProcess
+	{
+		event System.EventHandler Exited;
+		StreamReader StandardOutput { get; }
+		StreamReader StandardError { get; }
+		bool HasExited { get; }
+		void Kill ();
+		int Id { get; }
+		string ProcessName { get; }
+	}
+	
+	internal class ProcessWrapper: ITargetProcess
+	{
+		Process process;
+
+		public ProcessWrapper (Process process)
+		{
+			this.process = process;
+		}
+		
+		public Process Process {
+			get { return process; }
+		}
+		
+		public event System.EventHandler Exited {
+			add { process.Exited += value; }
+			remove { process.Exited -= value; }
+		}
+		
+		public StreamReader StandardOutput {
+			get {
+				return process.StandardOutput;
+			}
+		}
+		
+		public StreamReader StandardError {
+			get {
+				return process.StandardError;
+			}
+		}
+		
+		public bool HasExited {
+			get {
+				return process.HasExited;
+			}
+		}
+		
+		public void Kill ()
+		{
+			process.Kill ();
+		}
+
+		public int Id {
+			get {
+				return process.Id;
+			}
+		}
+		
+		public string ProcessName {
+			get {
+				return process.ProcessName;
+			}
+		}
+		
+		
+		
+	}
+}
diff --git a/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/ObjectMirror.cs b/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/ObjectMirror.cs
index e6e25fd..8b0db99 100644
--- a/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/ObjectMirror.cs
+++ b/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/ObjectMirror.cs
@@ -115,7 +115,7 @@ namespace Mono.Debugger.Soft
 			return BeginInvokeMethod (vm, thread, method, this, arguments, options, callback, state);
 		}
 
-	    public Value EndInvokeMethod (IAsyncResult asyncResult) {
+		public Value EndInvokeMethod (IAsyncResult asyncResult) {
 			return EndInvokeMethodInternal (asyncResult);
 		}
 
@@ -123,7 +123,7 @@ namespace Mono.Debugger.Soft
 		 * Common implementation for invokes
 		 */
 
-		class InvokeAsyncResult : IAsyncResult {
+		class InvokeAsyncResult : IInvokeAsyncResult {
 
 			public object AsyncState {
 				get; set;
@@ -155,6 +155,10 @@ namespace Mono.Debugger.Soft
 				get; set;
 			}
 
+			public ThreadMirror Thread {
+				get; set;
+			}
+
 			public ValueImpl Value {
 				get; set;
 			}
@@ -162,9 +166,21 @@ namespace Mono.Debugger.Soft
 			public ValueImpl Exception {
 				get; set;
 			}
+
+			public int ID {
+				get; set;
+			}
+
+			public void Abort ()
+			{
+				if (ID == 0) // Ooops
+					return;
+
+				ObjectMirror.AbortInvoke (VM, Thread, ID);
+			}
 		}
 
-		internal static IAsyncResult BeginInvokeMethod (VirtualMachine vm, ThreadMirror thread, MethodMirror method, Value this_obj, IList<Value> arguments, InvokeOptions options, AsyncCallback callback, object state) {
+		internal static IInvokeAsyncResult BeginInvokeMethod (VirtualMachine vm, ThreadMirror thread, MethodMirror method, Value this_obj, IList<Value> arguments, InvokeOptions options, AsyncCallback callback, object state) {
 			if (thread == null)
 				throw new ArgumentNullException ("thread");
 			if (method == null)
@@ -179,9 +195,9 @@ namespace Mono.Debugger.Soft
 			if ((options & InvokeOptions.SingleThreaded) != 0)
 				f |= InvokeFlags.SINGLE_THREADED;
 
-			InvokeAsyncResult r = new InvokeAsyncResult { AsyncState = state, AsyncWaitHandle = new ManualResetEvent (false), VM = vm, Callback = callback };
+			InvokeAsyncResult r = new InvokeAsyncResult { AsyncState = state, AsyncWaitHandle = new ManualResetEvent (false), VM = vm, Thread = thread, Callback = callback };
 
-			vm.conn.VM_BeginInvokeMethod (thread.Id, method.Id, this_obj != null ? vm.EncodeValue (this_obj) : vm.EncodeValue (vm.CreateValue (null)), vm.EncodeValues (arguments), f, InvokeCB, r);
+			r.ID = vm.conn.VM_BeginInvokeMethod (thread.Id, method.Id, this_obj != null ? vm.EncodeValue (this_obj) : vm.EncodeValue (vm.CreateValue (null)), vm.EncodeValues (arguments), f, InvokeCB, r);
 
 			return r;
 		}
@@ -234,5 +250,10 @@ namespace Mono.Debugger.Soft
 		internal static Value InvokeMethod (VirtualMachine vm, ThreadMirror thread, MethodMirror method, Value this_obj, IList<Value> arguments, InvokeOptions options) {
 			return EndInvokeMethodInternal (BeginInvokeMethod (vm, thread, method, this_obj, arguments, options, null, null));
 		}
+
+		internal static void AbortInvoke (VirtualMachine vm, ThreadMirror thread, int id)
+		{
+			vm.conn.VM_AbortInvoke (thread.Id, id);
+		}
 	}
 }
diff --git a/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/StackFrame.cs b/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/StackFrame.cs
index b3e6509..71fa126 100644
--- a/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/StackFrame.cs
+++ b/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/StackFrame.cs
@@ -1,4 +1,6 @@
 using System;
+using System.Collections.Generic;
+using System.Linq;
 
 namespace Mono.Debugger.Soft
 {
@@ -166,5 +168,22 @@ namespace Mono.Debugger.Soft
 					throw;
 			}
 		}
+
+		public IList<LocalVariable> GetVisibleVariables () {
+			if (Location.ILOffset == -1)
+				throw new AbsentInformationException ();
+
+			return Method.GetLocals ().Where (l => l.LiveRangeStart <= location.ILOffset && l.LiveRangeEnd >= location.ILOffset).ToList ();
+		}
+
+		public LocalVariable GetVisibleVariableByName (string name) {
+			if (name == null)
+				throw new ArgumentNullException ("name");
+
+			if (Location.ILOffset == -1)
+				throw new AbsentInformationException ();
+
+			return Method.GetLocals ().Where (l => l.LiveRangeStart <= location.ILOffset && l.LiveRangeEnd >= location.ILOffset && l.Name == name).FirstOrDefault ();
+		}
     }
 }
diff --git a/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/StructMirror.cs b/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/StructMirror.cs
index 922eb8b..1db6037 100644
--- a/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/StructMirror.cs
+++ b/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/StructMirror.cs
@@ -68,4 +68,4 @@ namespace Mono.Debugger.Soft
 			return ObjectMirror.EndInvokeMethodInternal (asyncResult);
 		}
 	}
-}
\ No newline at end of file
+}
diff --git a/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/ThreadMirror.cs b/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/ThreadMirror.cs
index 65e0c0f..d18804b 100644
--- a/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/ThreadMirror.cs
+++ b/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/ThreadMirror.cs
@@ -51,5 +51,15 @@ namespace Mono.Debugger.Soft
 				return info.is_thread_pool;
 			}
 		}
+
+		/*
+		 * Return a unique identifier for this thread, multiple ThreadMirror objects
+		 * may have the same ThreadId because of appdomains.
+		 */
+		public long ThreadId {
+			get {
+				return vm.conn.Thread_GetId (id);
+			}
+		}
     }
 }
diff --git a/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/TypeMirror.cs b/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/TypeMirror.cs
index d73b2df..1b9de53 100644
--- a/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/TypeMirror.cs
+++ b/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/TypeMirror.cs
@@ -508,7 +508,11 @@ namespace Mono.Debugger.Soft
 		 * have to be checked when placing breakpoints.
 		 */
 		public string[] GetSourceFiles () {
-			return vm.conn.Type_GetSourceFiles (id);
+			return GetSourceFiles (false);
+		}
+
+		public string[] GetSourceFiles (bool return_full_paths) {
+			return vm.conn.Type_GetSourceFiles (id, return_full_paths);
 		}
 
 		public C.TypeDefinition Metadata {
diff --git a/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/VirtualMachine.cs b/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/VirtualMachine.cs
index b816078..0571fa2 100644
--- a/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/VirtualMachine.cs
+++ b/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/VirtualMachine.cs
@@ -16,11 +16,13 @@ namespace Mono.Debugger.Soft
 		object startup_monitor;
 		AppDomainMirror root_domain;
 		Dictionary<int, EventRequest> requests;
-		Process process;
+		ITargetProcess process;
 
 		internal Connection conn;
 
-		internal VirtualMachine (Process process, Connection conn) : base () {
+		VersionInfo version;
+
+		internal VirtualMachine (ITargetProcess process, Connection conn) : base () {
 			SetVirtualMachine (this);
 			queue = new Queue ();
 			queue_monitor = new Object ();
@@ -35,8 +37,18 @@ namespace Mono.Debugger.Soft
 		public StreamReader StandardOutput { get; set; }
 		public StreamReader StandardError { get; set; }
 
+		
 		public Process Process {
 			get {
+				ProcessWrapper pw = process as ProcessWrapper;
+				if (pw == null)
+				    throw new InvalidOperationException ("Process instance not available");
+				return pw.Process;
+			}
+		}
+
+		public ITargetProcess TargetProcess {
+			get {
 				return process;
 			}
 		}
@@ -53,11 +65,24 @@ namespace Mono.Debugger.Soft
 			}
 		}
 
+		public VersionInfo Version {
+			get {
+				return version;
+			}
+		}
+
+		EventSet current_es;
+		int current_es_index;
+
 		public Event GetNextEvent () {
 			lock (queue_monitor) {
-				if (queue.Count == 0)
-					Monitor.Wait (queue_monitor);
-				return (Event)queue.Dequeue ();
+				if (current_es == null || current_es_index == current_es.Events.Length) {
+					if (queue.Count == 0)
+						Monitor.Wait (queue_monitor);
+					current_es = (EventSet)queue.Dequeue ();
+					current_es_index = 0;
+				}
+				return current_es.Events [current_es_index ++];
 			}
 		}
 
@@ -65,6 +90,18 @@ namespace Mono.Debugger.Soft
 			throw new NotImplementedException ();
 		}
 
+		public EventSet GetNextEventSet () {
+			lock (queue_monitor) {
+				if (queue.Count == 0)
+					Monitor.Wait (queue_monitor);
+
+				current_es = null;
+				current_es_index = 0;
+
+				return (EventSet)queue.Dequeue ();
+			}
+		}
+
 		public T GetNextEvent<T> () where T : Event {
 			return GetNextEvent () as T;
 		}
@@ -91,7 +128,7 @@ namespace Mono.Debugger.Soft
 		public void Dispose () {
 			conn.VM_Dispose ();
 			conn.Close ();
-			notify_vm_event (EventType.VMDisconnect, 0, 0, null);
+			notify_vm_event (EventType.VMDisconnect, SuspendPolicy.None, 0, 0, null);
 		}
 
 		public IList<ThreadMirror> GetThreads () {
@@ -168,9 +205,9 @@ namespace Mono.Debugger.Soft
 			conn.ClearAllBreakpoints ();
 		}
 
-		internal void queue_event (Event e) {
+		internal void queue_event_set (EventSet es) {
 			lock (queue_monitor) {
-				queue.Enqueue (e);
+				queue.Enqueue (es);
 				Monitor.Pulse (queue_monitor);
 			}
 		}
@@ -185,6 +222,8 @@ namespace Mono.Debugger.Soft
 				throw new InvalidOperationException ("The vm is not suspended.");
 			case ErrorCode.NOT_IMPLEMENTED:
 				throw new NotSupportedException ("This request is not supported by the protocol version implemented by the debuggee.");
+			case ErrorCode.ABSENT_INFORMATION:
+				throw new AbsentInformationException ();
 			default:
 				throw new CommandException (args.ErrorCode);
 			}
@@ -195,15 +234,15 @@ namespace Mono.Debugger.Soft
 			conn.Connect ();
 
 			// Test the connection
-			VersionInfo ver = conn.Version;
-			if (ver.MajorVersion != Connection.MAJOR_VERSION)
-				throw new NotSupportedException (String.Format ("The debuggee implements protocol version {0}.{1}, while {2}.{3} is required.", ver.MajorVersion, ver.MinorVersion, Connection.MAJOR_VERSION, Connection.MINOR_VERSION));
+			version = conn.Version;
+			if (version.MajorVersion != Connection.MAJOR_VERSION)
+				throw new NotSupportedException (String.Format ("The debuggee implements protocol version {0}.{1}, while {2}.{3} is required.", version.MajorVersion, version.MinorVersion, Connection.MAJOR_VERSION, Connection.MINOR_VERSION));
 
 			long root_domain_id = conn.RootDomain;
 			root_domain = GetDomain (root_domain_id);
 		}
 
-		internal void notify_vm_event (EventType evtype, int req_id, long thread_id, string vm_uri) {
+		internal void notify_vm_event (EventType evtype, SuspendPolicy spolicy, int req_id, long thread_id, string vm_uri) {
 			//Console.WriteLine ("Event: " + evtype + "(" + vm_uri + ")");
 
 			switch (evtype) {
@@ -212,13 +251,13 @@ namespace Mono.Debugger.Soft
 				lock (startup_monitor) {
 					Monitor.Pulse (startup_monitor);
 				}
-				queue_event (new VMStartEvent (vm, req_id, thread_id));
+				queue_event_set (new EventSet (this, spolicy, new Event[] { new VMStartEvent (vm, req_id, thread_id) }));
 				break;
 			case EventType.VMDeath:
-				queue_event (new VMDeathEvent (vm, req_id));
+				queue_event_set (new EventSet (this, spolicy, new Event[] { new VMDeathEvent (vm, req_id) }));
 				break;
 			case EventType.VMDisconnect:
-				queue_event (new VMDisconnectEvent (vm, req_id));
+				queue_event_set (new EventSet (this, spolicy, new Event[] { new VMDisconnectEvent (vm, req_id) }));
 				break;
 			default:
 				throw new Exception ();
@@ -477,64 +516,70 @@ namespace Mono.Debugger.Soft
 			this.vm = vm;
 		}
 
-		public void VMStart (int req_id, long thread_id, string vm_uri) {
-			vm.notify_vm_event (EventType.VMStart, req_id, thread_id, vm_uri);
-        }
-
-		public void VMDeath (int req_id, long thread_id, string vm_uri) {
-			vm.notify_vm_event (EventType.VMDeath, req_id, thread_id, vm_uri);
-        }
+		public void Events (SuspendPolicy suspend_policy, EventInfo[] events) {
+			var l = new List<Event> ();
+
+			for (int i = 0; i < events.Length; ++i) {
+				EventInfo ei = events [i];
+				int req_id = ei.ReqId;
+				long thread_id = ei.ThreadId;
+				long id = ei.Id;
+				long loc = ei.Location;
+
+				switch (ei.EventType) {
+				case EventType.VMStart:
+					vm.notify_vm_event (EventType.VMStart, suspend_policy, req_id, thread_id, null);
+					break;
+				case EventType.VMDeath:
+					vm.notify_vm_event (EventType.VMDeath, suspend_policy, req_id, thread_id, null);
+					break;
+				case EventType.ThreadStart:
+					l.Add (new ThreadStartEvent (vm, req_id, id));
+					break;
+				case EventType.ThreadDeath:
+					l.Add (new ThreadDeathEvent (vm, req_id, id));
+					break;
+				case EventType.AssemblyLoad:
+					l.Add (new AssemblyLoadEvent (vm, req_id, thread_id, id));
+					break;
+				case EventType.AssemblyUnload:
+					l.Add (new AssemblyUnloadEvent (vm, req_id, thread_id, id));
+					break;
+				case EventType.TypeLoad:
+					l.Add (new TypeLoadEvent (vm, req_id, thread_id, id));
+					break;
+				case EventType.MethodEntry:
+					l.Add (new MethodEntryEvent (vm, req_id, thread_id, id));
+					break;
+				case EventType.MethodExit:
+					l.Add (new MethodExitEvent (vm, req_id, thread_id, id));
+					break;
+				case EventType.Breakpoint:
+					l.Add (new BreakpointEvent (vm, req_id, thread_id, id, loc));
+					break;
+				case EventType.Step:
+					l.Add (new StepEvent (vm, req_id, thread_id, id, loc));
+					break;
+				case EventType.Exception:
+					l.Add (new ExceptionEvent (vm, req_id, thread_id, id, loc));
+					break;
+				case EventType.AppDomainCreate:
+					l.Add (new AppDomainCreateEvent (vm, req_id, thread_id, id));
+					break;
+				case EventType.AppDomainUnload:
+					l.Add (new AppDomainUnloadEvent (vm, req_id, thread_id, id));
+					break;
+				default:
+					break;
+				}
+			}
+			
+			if (l.Count > 0)
+				vm.queue_event_set (new EventSet (vm, suspend_policy, l.ToArray ()));
+		}
 
 		public void VMDisconnect (int req_id, long thread_id, string vm_uri) {
-			vm.notify_vm_event (EventType.VMDisconnect, req_id, thread_id, vm_uri);
-        }
-
-		public void ThreadStart (int req_id, long thread_id, long id) {
-			vm.queue_event (new ThreadStartEvent (vm, req_id, id));
-        }
-
-		public void ThreadDeath (int req_id, long thread_id, long id) {
-			vm.queue_event (new ThreadDeathEvent (vm, req_id, id));
-        }
-
-		public void AssemblyLoad (int req_id, long thread_id, long id) {
-			vm.queue_event (new AssemblyLoadEvent (vm, req_id, thread_id, id));
-        }
-
-		public void AssemblyUnload (int req_id, long thread_id, long id) {
-			vm.queue_event (new AssemblyUnloadEvent (vm, req_id, thread_id, id));
-        }
-
-		public void TypeLoad (int req_id, long thread_id, long id) {
-			vm.queue_event (new TypeLoadEvent (vm, req_id, thread_id, id));
-        }
-
-		public void MethodEntry (int req_id, long thread_id, long id) {
-			vm.queue_event (new MethodEntryEvent (vm, req_id, thread_id, id));
-        }
-
-		public void MethodExit (int req_id, long thread_id, long id) {
-			vm.queue_event (new MethodExitEvent (vm, req_id, thread_id, id));
-        }
-
-		public void Breakpoint (int req_id, long thread_id, long id, long loc) {
-			vm.queue_event (new BreakpointEvent (vm, req_id, thread_id, id, loc));
-        }
-
-		public void Step (int req_id, long thread_id, long id, long loc) {
-			vm.queue_event (new StepEvent (vm, req_id, thread_id, id, loc));
-        }
-
-		public void Exception (int req_id, long thread_id, long id, long loc) {
-			vm.queue_event (new ExceptionEvent (vm, req_id, thread_id, id, loc));
-        }
-
-		public void AppDomainCreate (int req_id, long thread_id, long id) {
-			vm.queue_event (new AppDomainCreateEvent (vm, req_id, thread_id, id));
-        }
-
-		public void AppDomainUnload (int req_id, long thread_id, long id) {
-			vm.queue_event (new AppDomainUnloadEvent (vm, req_id, thread_id, id));
+			vm.notify_vm_event (EventType.VMDisconnect, SuspendPolicy.None, req_id, thread_id, vm_uri);
         }
     }
 
diff --git a/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/VirtualMachineManager.cs b/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/VirtualMachineManager.cs
index 9329634..506b6ae 100644
--- a/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/VirtualMachineManager.cs
+++ b/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/VirtualMachineManager.cs
@@ -21,18 +21,28 @@ namespace Mono.Debugger.Soft
 			get; set;
 		}
 
+		public TargetProcessLauncher CustomTargetProcessLauncher {
+			get; set;
+		}
+
 		public delegate Process ProcessLauncher (ProcessStartInfo info);
+		public delegate ITargetProcess TargetProcessLauncher (ProcessStartInfo info);
 	}
 
 	public class VirtualMachineManager
 	{
-		private delegate VirtualMachine LaunchCallback (Process p, Socket socket);
+		private delegate VirtualMachine LaunchCallback (ITargetProcess p, ProcessStartInfo info, Socket socket);
 		private delegate VirtualMachine ListenCallback (Socket dbg_sock, Socket con_sock); 
 
 		internal VirtualMachineManager () {
 		}
 
-		public static VirtualMachine LaunchInternal (Process p, Socket socket) {
+		public static VirtualMachine LaunchInternal (Process p, ProcessStartInfo info, Socket socket)
+		{
+			return LaunchInternal (new ProcessWrapper (p), info, socket);
+		}
+			
+		public static VirtualMachine LaunchInternal (ITargetProcess p, ProcessStartInfo info, Socket socket) {
 			Socket accepted = null;
 			try {
 				accepted = socket.Accept ();
@@ -44,10 +54,10 @@ namespace Mono.Debugger.Soft
 
 			VirtualMachine vm = new VirtualMachine (p, conn);
 
-			if (p.StartInfo.RedirectStandardOutput)
+			if (info.RedirectStandardOutput)
 				vm.StandardOutput = p.StandardOutput;
 			
-			if (p.StartInfo.RedirectStandardError)
+			if (info.RedirectStandardError)
 				vm.StandardError = p.StandardError;
 
 			conn.EventHandler = new EventHandler (vm);
@@ -77,18 +87,20 @@ namespace Mono.Debugger.Soft
 			if (options != null && options.Valgrind)
 				info.FileName = "valgrind";
 				
-			Process p;
+			ITargetProcess p;
 			if (options != null && options.CustomProcessLauncher != null)
-				p = options.CustomProcessLauncher (info);
+				p = new ProcessWrapper (options.CustomProcessLauncher (info));
+			else if (options != null && options.CustomTargetProcessLauncher != null)
+				p = options.CustomTargetProcessLauncher (info);
 			else
-				p = Process.Start (info);
+				p = new ProcessWrapper (Process.Start (info));
 			
 			p.Exited += delegate (object sender, EventArgs eargs) {
 				socket.Close ();
 			};
 
 			LaunchCallback c = new LaunchCallback (LaunchInternal);
-			return c.BeginInvoke (p, socket, callback, socket);
+			return c.BeginInvoke (p, info, socket, callback, socket);
 		}
 
 		public static VirtualMachine EndLaunch (IAsyncResult asyncResult) {
diff --git a/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft_test.dll.sources b/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft_test.dll.sources
new file mode 100644
index 0000000..a0dffae
--- /dev/null
+++ b/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft_test.dll.sources
@@ -0,0 +1 @@
+dtest.cs
diff --git a/mcs/class/Mono.Debugger.Soft/Test/ChangeLog b/mcs/class/Mono.Debugger.Soft/Test/ChangeLog
new file mode 100644
index 0000000..e36de05
--- /dev/null
+++ b/mcs/class/Mono.Debugger.Soft/Test/ChangeLog
@@ -0,0 +1,9 @@
+2010-06-17  Zoltan Varga  <vargaz at gmail.com>
+
+	* dtest.cs: Add an EventSet test.
+
+2010-06-15  Zoltan Varga  <vargaz at gmail.com>
+
+	* dtest.cs dtest-app.cs: New files containing the soft debugger tests, moved here
+	from mono/tests.
+
diff --git a/mcs/class/Mono.Debugger.Soft/Test/dtest.cs b/mcs/class/Mono.Debugger.Soft/Test/dtest.cs
new file mode 100644
index 0000000..62d52df
--- /dev/null
+++ b/mcs/class/Mono.Debugger.Soft/Test/dtest.cs
@@ -0,0 +1,2388 @@
+using System;
+using System.Collections.Generic;
+using System.Threading;
+using System.Net;
+using System.Reflection;
+using Mono.Cecil.Cil;
+using Mono.Debugger.Soft;
+using Diag = System.Diagnostics;
+using System.Linq;
+
+using NUnit.Framework;
+
+#pragma warning disable 0219
+
+[TestFixture]
+public class DebuggerTests
+{
+	VirtualMachine vm;
+	MethodMirror entry_point;
+	StepEventRequest step_req;
+
+	void AssertThrows<ExType> (Action del) where ExType : Exception {
+		bool thrown = false;
+
+		try {
+			del ();
+		} catch (ExType) {
+			thrown = true;
+		}
+		Assert.IsTrue (thrown);
+	}
+
+	// No other way to pass arguments to the tests ?
+	public static bool listening = Environment.GetEnvironmentVariable ("DBG_SUSPEND") != null;
+	public static string runtime = Environment.GetEnvironmentVariable ("DBG_RUNTIME");
+	public static string agent_args = Environment.GetEnvironmentVariable ("DBG_AGENT_ARGS");
+
+	void Start (string[] args) {
+		if (!listening) {
+			var pi = new Diag.ProcessStartInfo ();
+
+			if (runtime != null)
+				pi.FileName = runtime;
+			else
+				pi.FileName = "mono";
+			pi.Arguments = String.Join (" ", args);
+			vm = VirtualMachineManager.Launch (pi, new LaunchOptions { AgentArgs = agent_args });
+		} else {
+			Console.WriteLine ("Listening...");
+			vm = VirtualMachineManager.Listen (new IPEndPoint (IPAddress.Any, 10000));
+		}
+
+		vm.EnableEvents (EventType.AssemblyLoad);
+
+		Event vmstart = vm.GetNextEvent ();
+		Assert.AreEqual (EventType.VMStart, vmstart.EventType);
+
+		vm.Resume ();
+
+		entry_point = null;
+		step_req = null;
+
+		Event e;
+
+		/* Find out the entry point */
+		while (true) {
+			e = vm.GetNextEvent ();
+
+			if (e is AssemblyLoadEvent) {
+				AssemblyLoadEvent ae = (AssemblyLoadEvent)e;
+				entry_point = ae.Assembly.EntryPoint;
+				if (entry_point != null)
+					break;
+			}
+
+			vm.Resume ();
+		}
+	}
+
+	BreakpointEvent run_until (string name) {
+		// String
+		MethodMirror m = entry_point.DeclaringType.GetMethod (name);
+		Assert.IsNotNull (m);
+		vm.SetBreakpoint (m, 0);
+
+		Event e = null;
+
+		while (true) {
+			vm.Resume ();
+			e = vm.GetNextEvent ();
+			if (e is BreakpointEvent)
+				break;
+		}
+
+		Assert.IsInstanceOfType (typeof (BreakpointEvent), e);
+		Assert.AreEqual (m, (e as BreakpointEvent).Method);
+
+		return (e as BreakpointEvent);
+	}
+
+	Event single_step (ThreadMirror t) {
+		var req = vm.CreateStepRequest (t);
+		req.Enable ();
+
+		vm.Resume ();
+		Event e = vm.GetNextEvent ();
+		Assert.IsTrue (e is StepEvent);
+
+		req.Disable ();
+
+		return e;
+	}
+
+	void check_arg_val (StackFrame frame, int pos, Type type, object eval) {
+		object val = frame.GetArgument (pos);
+		Assert.IsTrue (val is PrimitiveValue);
+		object v = (val as PrimitiveValue).Value;
+		Assert.AreEqual (type, v.GetType ());
+		if (eval is float)
+			Assert.IsTrue (Math.Abs ((float)eval - (float)v) < 0.0001);
+		else if (eval is double)
+			Assert.IsTrue (Math.Abs ((double)eval - (double)v) < 0.0001);
+		else
+			Assert.AreEqual (eval, v);
+	}
+
+	void AssertValue (object expected, object val) {
+		if (expected is string) {
+			Assert.IsTrue (val is StringMirror);
+			Assert.AreEqual (expected, (val as StringMirror).Value);
+		} else if (val is StructMirror && (val as StructMirror).Type.Name == "IntPtr") {
+			AssertValue (expected, (val as StructMirror).Fields [0]);
+		} else {
+			Assert.IsTrue (val is PrimitiveValue);
+			Assert.AreEqual (expected, (val as PrimitiveValue).Value);
+		}
+	}
+
+	[SetUp]
+	public void SetUp () {
+		Start (new string [] { "dtest-app.exe" });
+	}
+
+	[TearDown]
+	public void TearDown () {
+		if (vm == null)
+			return;
+
+		if (step_req != null)
+			step_req.Disable ();
+
+		vm.Resume ();
+		while (true) {
+			Event e = vm.GetNextEvent ();
+
+			if (e is VMDeathEvent)
+				break;
+
+			vm.Resume ();
+		}
+	}
+
+	[Test]
+	public void SimpleBreakpoint () {
+		Event e;
+
+		MethodMirror m = entry_point.DeclaringType.GetMethod ("bp1");
+		Assert.IsNotNull (m);
+
+		vm.SetBreakpoint (m, 0);
+
+		vm.Resume ();
+
+		e = vm.GetNextEvent ();
+		Assert.AreEqual (EventType.Breakpoint, e.EventType);
+		Assert.IsTrue (e is BreakpointEvent);
+		Assert.AreEqual (m.Name, (e as BreakpointEvent).Method.Name);
+
+		// Argument checking
+		AssertThrows<ArgumentException> (delegate {
+				// Invalid IL offset
+				vm.SetBreakpoint (m, 1);
+			});
+	}
+
+	[Test]
+	public void BreakpointsSameLocation () {
+		Event e;
+
+		MethodMirror m = entry_point.DeclaringType.GetMethod ("bp2");
+		Assert.IsNotNull (m);
+
+		vm.SetBreakpoint (m, 0);
+		vm.SetBreakpoint (m, 0);
+
+		vm.Resume ();
+
+		e = vm.GetNextEvent ();
+		Assert.IsTrue (e is BreakpointEvent);
+		Assert.AreEqual (m, (e as BreakpointEvent).Method);
+
+		e = vm.GetNextEvent ();
+		Assert.IsTrue (e is BreakpointEvent);
+		Assert.AreEqual (m.Name, (e as BreakpointEvent).Method.Name);
+	}
+
+	[Test]
+	public void BreakpointAlreadyJITted () {
+		Event e = run_until ("bp1");
+
+		/* Place a breakpoint on bp3 */
+		MethodMirror m = entry_point.DeclaringType.GetMethod ("bp3");
+		Assert.IsNotNull (m);
+		vm.SetBreakpoint (m, 0);
+
+		/* Same with generic instances */
+		MethodMirror m2 = entry_point.DeclaringType.GetMethod ("bp7");
+		Assert.IsNotNull (m2);
+		vm.SetBreakpoint (m2, 0);
+
+		vm.Resume ();
+
+		e = vm.GetNextEvent ();
+		Assert.AreEqual (EventType.Breakpoint, e.EventType);
+		Assert.AreEqual (m.Name, (e as BreakpointEvent).Method.Name);
+
+		vm.Resume ();
+
+		/* Non-shared instance */
+		e = vm.GetNextEvent ();
+		Assert.AreEqual (EventType.Breakpoint, e.EventType);
+		Assert.AreEqual (m2.Name, (e as BreakpointEvent).Method.Name);
+
+		vm.Resume ();
+
+		/* Shared instance */
+		e = vm.GetNextEvent ();
+		Assert.AreEqual (EventType.Breakpoint, e.EventType);
+		Assert.AreEqual (m2.Name, (e as BreakpointEvent).Method.Name);
+	}
+
+	[Test]
+	public void ClearBreakpoint () {
+		Event e;
+
+		MethodMirror m = entry_point.DeclaringType.GetMethod ("bp4");
+		Assert.IsNotNull (m);
+		EventRequest req1 = vm.SetBreakpoint (m, 0);
+		EventRequest req2 = vm.SetBreakpoint (m, 0);
+
+		MethodMirror m2 = entry_point.DeclaringType.GetMethod ("bp5");
+		Assert.IsNotNull (m2);
+		vm.SetBreakpoint (m2, 0);
+
+		/* Run until bp4 */
+		vm.Resume ();
+
+		e = vm.GetNextEvent ();
+		Assert.AreEqual (EventType.Breakpoint, e.EventType);
+		Assert.AreEqual (m.Name, (e as BreakpointEvent).Method.Name);
+		e = vm.GetNextEvent ();
+		Assert.AreEqual (EventType.Breakpoint, e.EventType);
+		Assert.AreEqual (m.Name, (e as BreakpointEvent).Method.Name);
+
+		/* Clear one of them */
+		req1.Disable ();
+
+		vm.Resume ();
+
+		e = vm.GetNextEvent ();
+		Assert.AreEqual (EventType.Breakpoint, e.EventType);
+		Assert.AreEqual (m.Name, (e as BreakpointEvent).Method.Name);
+
+		/* Clear the other */
+		req2.Disable ();
+
+		vm.Resume ();
+
+		e = vm.GetNextEvent ();
+		Assert.AreEqual (EventType.Breakpoint, e.EventType);
+		Assert.AreEqual (m2.Name, (e as BreakpointEvent).Method.Name);
+	}
+
+	[Test]
+	public void ClearAllBreakpoints () {
+		Event e;
+
+		MethodMirror m = entry_point.DeclaringType.GetMethod ("bp4");
+		Assert.IsNotNull (m);
+		vm.SetBreakpoint (m, 0);
+
+		MethodMirror m2 = entry_point.DeclaringType.GetMethod ("bp5");
+		Assert.IsNotNull (m2);
+		vm.SetBreakpoint (m2, 0);
+
+		vm.ClearAllBreakpoints ();
+
+		vm.Resume ();
+
+		e = vm.GetNextEvent ();
+		Assert.IsTrue (!(e is BreakpointEvent));
+		if (e is VMDeathEvent)
+			vm = null;
+	}
+
+	[Test]
+	public void BreakpointOnGShared () {
+		Event e;
+
+		MethodMirror m = entry_point.DeclaringType.GetMethod ("bp6");
+		Assert.IsNotNull (m);
+
+		vm.SetBreakpoint (m, 0);
+
+		vm.Resume ();
+
+		e = vm.GetNextEvent ();
+		Assert.AreEqual (EventType.Breakpoint, e.EventType);
+		Assert.IsTrue (e is BreakpointEvent);
+		Assert.AreEqual (m.Name, (e as BreakpointEvent).Method.Name);
+	}
+
+	[Test]
+	public void SingleStepping () {
+		Event e = run_until ("single_stepping");
+
+		var req = vm.CreateStepRequest (e.Thread);
+		req.Enable ();
+
+		step_req = req;
+
+		// Step into ss1
+		vm.Resume ();
+		e = vm.GetNextEvent ();
+		Assert.IsTrue (e is StepEvent);
+		Assert.AreEqual ("ss1", (e as StepEvent).Method.Name);
+
+		// Step out of ss1
+		vm.Resume ();
+		e = vm.GetNextEvent ();
+		Assert.IsTrue (e is StepEvent);
+		Assert.AreEqual ("single_stepping", (e as StepEvent).Method.Name);
+
+		// Change to step over
+		req.Disable ();
+		req.Depth = StepDepth.Over;
+		req.Enable ();
+
+		// Step over ss2
+		vm.Resume ();
+		e = vm.GetNextEvent ();
+		Assert.IsTrue (e is StepEvent);
+		Assert.AreEqual ("single_stepping", (e as StepEvent).Method.Name);
+
+		// Change to step into
+		req.Disable ();
+		req.Depth = StepDepth.Into;
+		req.Enable ();
+
+		// Step into ss3
+		vm.Resume ();
+		e = vm.GetNextEvent ();
+		Assert.IsTrue (e is StepEvent);
+		Assert.AreEqual ("ss3", (e as StepEvent).Method.Name);
+
+		// Change to step out
+		req.Disable ();
+		req.Depth = StepDepth.Out;
+		req.Enable ();
+
+		// Step back into single_stepping
+		vm.Resume ();
+		e = vm.GetNextEvent ();
+		Assert.IsTrue (e is StepEvent);
+		Assert.AreEqual ("single_stepping", (e as StepEvent).Method.Name);
+
+		// Change to step into
+		req.Disable ();
+		req.Depth = StepDepth.Into;
+		req.Enable ();
+
+		// Step into ss3_2 ()
+		vm.Resume ();
+		e = vm.GetNextEvent ();
+		Assert.IsTrue (e is StepEvent);
+		Assert.AreEqual ("ss3_2", (e as StepEvent).Method.Name);
+
+		// Change to step over
+		req.Disable ();
+		req.Depth = StepDepth.Over;
+		req.Enable ();
+
+		// Step over ss3_2_2 ()
+		vm.Resume ();
+		e = vm.GetNextEvent ();
+		Assert.IsTrue (e is StepEvent);
+		Assert.AreEqual ("ss3_2", (e as StepEvent).Method.Name);
+
+		// Recreate the request
+		req.Disable ();
+		req.Enable ();
+
+		// Step back into single_stepping () with the new request
+		vm.Resume ();
+		e = vm.GetNextEvent ();
+		Assert.IsTrue (e is StepEvent);
+		Assert.AreEqual ("single_stepping", (e as StepEvent).Method.Name);
+
+		// Change to step into
+		req.Disable ();
+		req.Depth = StepDepth.Into;
+		req.Enable ();
+
+		// Step into ss4 ()
+		vm.Resume ();
+		e = vm.GetNextEvent ();
+		Assert.IsTrue (e is StepEvent);
+		Assert.AreEqual ("ss4", (e as StepEvent).Method.Name);
+
+		// Change to StepSize.Line
+		req.Disable ();
+		req.Depth = StepDepth.Over;
+		req.Size = StepSize.Line;
+		req.Enable ();
+
+		// Step over ss1 (); ss1 ();
+		vm.Resume ();
+		e = vm.GetNextEvent ();
+		Assert.IsTrue (e is StepEvent);
+
+		// Step into ss2 ()
+		req.Disable ();
+		req.Depth = StepDepth.Into;
+		req.Enable ();
+
+		vm.Resume ();
+		e = vm.GetNextEvent ();
+		Assert.IsTrue (e is StepEvent);
+		Assert.AreEqual ("ss2", (e as StepEvent).Method.Name);
+
+		req.Disable ();
+
+		// Run until ss5
+		e = run_until ("ss5");
+
+		// Add an assembly filter
+		req.AssemblyFilter = new AssemblyMirror [] { (e as BreakpointEvent).Method.DeclaringType.Assembly };
+		req.Enable ();
+
+		// Step into is_even, skipping the linq stuff
+		vm.Resume ();
+		e = vm.GetNextEvent ();
+		Assert.IsTrue (e is StepEvent);
+		Assert.AreEqual ("is_even", (e as StepEvent).Method.Name);
+
+		// FIXME: Check that single stepping works with lock (obj)
+		
+		req.Disable ();
+
+		// Run until ss6
+		e = run_until ("ss6");
+
+		req = vm.CreateStepRequest (e.Thread);
+		req.Depth = StepDepth.Over;
+		req.Enable ();
+
+		// Check that single stepping works in out-of-line bblocks
+		vm.Resume ();
+		e = vm.GetNextEvent ();
+		Assert.IsTrue (e is StepEvent);
+		vm.Resume ();
+		e = vm.GetNextEvent ();
+		Assert.IsTrue (e is StepEvent);
+		Assert.AreEqual ("ss6", (e as StepEvent).Method.Name);
+
+		req.Disable ();
+	}
+
+	[Test]
+	public void MethodEntryExit () {
+		run_until ("single_stepping");
+
+		var req1 = vm.CreateMethodEntryRequest ();
+		var req2 = vm.CreateMethodExitRequest ();
+
+		req1.Enable ();
+		req2.Enable ();
+
+		vm.Resume ();
+		Event e = vm.GetNextEvent ();
+		Assert.IsTrue (e is MethodEntryEvent);
+		Assert.AreEqual ("ss1", (e as MethodEntryEvent).Method.Name);
+
+		vm.Resume ();
+		e = vm.GetNextEvent ();
+		Assert.IsTrue (e is MethodExitEvent);
+		Assert.AreEqual ("ss1", (e as MethodExitEvent).Method.Name);
+
+		req1.Disable ();
+		req2.Disable ();
+	}
+
+	[Test]
+	public void CountFilter () {
+		run_until ("single_stepping");
+
+		MethodMirror m2 = entry_point.DeclaringType.GetMethod ("ss3");
+		Assert.IsNotNull (m2);
+		vm.SetBreakpoint (m2, 0);
+
+		var req1 = vm.CreateMethodEntryRequest ();
+		req1.Count = 2;
+		req1.Enable ();
+
+		// Enter ss2, ss1 is skipped
+		vm.Resume ();
+		Event e = vm.GetNextEvent ();
+		Assert.IsTrue (e is MethodEntryEvent);
+		Assert.AreEqual ("ss2", (e as MethodEntryEvent).Method.Name);
+
+		// Breakpoint on ss3, the entry event is no longer reported
+		vm.Resume ();
+		e = vm.GetNextEvent ();
+		Assert.IsTrue (e is BreakpointEvent);
+
+		req1.Disable ();
+	}
+
+	[Test]
+	public void Arguments () {
+		object val;
+
+		var e = run_until ("arg1");
+
+		StackFrame frame = e.Thread.GetFrames () [0];
+
+		check_arg_val (frame, 0, typeof (sbyte), SByte.MaxValue - 5);
+		check_arg_val (frame, 1, typeof (byte), Byte.MaxValue - 5);
+		check_arg_val (frame, 2, typeof (bool), true);
+		check_arg_val (frame, 3, typeof (short), Int16.MaxValue - 5);
+		check_arg_val (frame, 4, typeof (ushort), UInt16.MaxValue - 5);
+		check_arg_val (frame, 5, typeof (char), 'F');
+		check_arg_val (frame, 6, typeof (int), Int32.MaxValue - 5);
+		check_arg_val (frame, 7, typeof (uint), UInt32.MaxValue - 5);
+		check_arg_val (frame, 8, typeof (long), Int64.MaxValue - 5);
+		check_arg_val (frame, 9, typeof (ulong), UInt64.MaxValue - 5);
+		check_arg_val (frame, 10, typeof (float), 1.2345f);
+		check_arg_val (frame, 11, typeof (double), 6.78910);
+
+		e = run_until ("arg2");
+
+		frame = e.Thread.GetFrames () [0];
+
+		// String
+		val = frame.GetArgument (0);
+		AssertValue ("FOO", val);
+		Assert.AreEqual ("String", (val as ObjectMirror).Type.Name);
+
+		// null
+		val = frame.GetArgument (1);
+		AssertValue (null, val);
+
+		// object
+		val = frame.GetArgument (2);
+		AssertValue ("BLA", val);
+
+		// byref
+		val = frame.GetArgument (3);
+		AssertValue (42, val);
+
+		// generic instance
+		val = frame.GetArgument (4);
+		Assert.IsTrue (val is ObjectMirror);
+		Assert.AreEqual ("GClass`1", (val as ObjectMirror).Type.Name);
+
+		// System.Object
+		val = frame.GetArgument (5);
+		Assert.IsTrue (val is ObjectMirror);
+		Assert.AreEqual ("Object", (val as ObjectMirror).Type.Name);
+
+		// this on static methods
+		val = frame.GetThis ();
+		AssertValue (null, val);
+
+		e = run_until ("arg3");
+
+		frame = e.Thread.GetFrames () [0];
+
+		// this
+		val = frame.GetThis ();
+		Assert.IsTrue (val is ObjectMirror);
+		Assert.AreEqual ("Tests", (val as ObjectMirror).Type.Name);
+
+		// objref in register
+		val = frame.GetArgument (0);
+		AssertValue ("BLA", val);
+	}
+
+	[Test]
+	public void Arrays () {
+		object val;
+
+		var e = run_until ("o2");
+
+		StackFrame frame = e.Thread.GetFrames () [0];
+
+		// String[]
+		val = frame.GetArgument (0);
+		Assert.IsTrue (val is ArrayMirror);
+		ArrayMirror arr = val as ArrayMirror;
+		Assert.AreEqual (2, arr.Length);
+		AssertValue ("BAR", arr [0]);
+		AssertValue ("BAZ", arr [1]);
+
+		var vals = arr.GetValues (0, 2);
+		Assert.AreEqual (2, vals.Count);
+		AssertValue ("BAR", vals [0]);
+		AssertValue ("BAZ", vals [1]);
+
+		arr [0] = vm.RootDomain.CreateString ("ABC");
+		AssertValue ("ABC", arr [0]);
+
+		arr [0] = vm.CreateValue (null);
+		AssertValue (null, arr [0]);
+
+		arr.SetValues (0, new Value [] { vm.RootDomain.CreateString ("D1"), vm.RootDomain.CreateString ("D2") });
+		AssertValue ("D1", arr [0]);
+		AssertValue ("D2", arr [1]);
+
+		// int
+		val = frame.GetArgument (1);
+		Assert.IsTrue (val is ArrayMirror);
+		arr = val as ArrayMirror;
+		Assert.AreEqual (2, arr.Length);
+		AssertValue (42, arr [0]);
+		AssertValue (43, arr [1]);
+
+		// Argument checking
+		AssertThrows<IndexOutOfRangeException> (delegate () {
+				val = arr [2];
+			});
+
+		AssertThrows<IndexOutOfRangeException> (delegate () {
+				val = arr [Int32.MinValue];
+			});
+
+		AssertThrows<IndexOutOfRangeException> (delegate () {
+				vals = arr.GetValues (0, 3);
+			});
+
+		AssertThrows<IndexOutOfRangeException> (delegate () {
+				arr [2] = vm.CreateValue (null);
+			});
+
+		AssertThrows<IndexOutOfRangeException> (delegate () {
+				arr [Int32.MinValue] = vm.CreateValue (null);
+			});
+
+		AssertThrows<IndexOutOfRangeException> (delegate () {
+				arr.SetValues (0, new Value [] { null, null, null });
+			});
+
+		// Multidim arrays
+		val = frame.GetArgument (2);
+		Assert.IsTrue (val is ArrayMirror);
+		arr = val as ArrayMirror;
+		Assert.AreEqual (2, arr.Rank);
+		Assert.AreEqual (4, arr.Length);
+		Assert.AreEqual (2, arr.GetLength (0));
+		Assert.AreEqual (2, arr.GetLength (1));
+		Assert.AreEqual (0, arr.GetLowerBound (0));
+		Assert.AreEqual (0, arr.GetLowerBound (1));
+		vals = arr.GetValues (0, 4);
+		AssertValue (1, vals [0]);
+		AssertValue (2, vals [1]);
+		AssertValue (3, vals [2]);
+		AssertValue (4, vals [3]);
+
+		val = frame.GetArgument (3);
+		Assert.IsTrue (val is ArrayMirror);
+		arr = val as ArrayMirror;
+		Assert.AreEqual (2, arr.Rank);
+		Assert.AreEqual (4, arr.Length);
+		Assert.AreEqual (2, arr.GetLength (0));
+		Assert.AreEqual (2, arr.GetLength (1));
+		Assert.AreEqual (1, arr.GetLowerBound (0));
+		Assert.AreEqual (3, arr.GetLowerBound (1));
+
+		AssertThrows<ArgumentOutOfRangeException> (delegate () {
+				arr.GetLength (-1);
+			});
+		AssertThrows<ArgumentOutOfRangeException> (delegate () {
+				arr.GetLength (2);
+			});
+
+		AssertThrows<ArgumentOutOfRangeException> (delegate () {
+				arr.GetLowerBound (-1);
+			});
+		AssertThrows<ArgumentOutOfRangeException> (delegate () {
+				arr.GetLowerBound (2);
+			});
+
+		// arrays treated as generic collections
+		val = frame.GetArgument (4);
+		Assert.IsTrue (val is ArrayMirror);
+		arr = val as ArrayMirror;
+	}
+
+	[Test]
+	public void Object_GetValue () {
+		var e = run_until ("o1");
+		var frame = e.Thread.GetFrames () [0];
+
+		object val = frame.GetThis ();
+		Assert.IsTrue (val is ObjectMirror);
+		Assert.AreEqual ("Tests", (val as ObjectMirror).Type.Name);
+		ObjectMirror o = (val as ObjectMirror);
+
+		TypeMirror t = o.Type;
+
+		// object fields
+		object f = o.GetValue (t.GetField ("field_i"));
+		AssertValue (42, f);
+		f = o.GetValue (t.GetField ("field_s"));
+		AssertValue ("S", f);
+		f = o.GetValue (t.GetField ("field_enum"));
+		Assert.IsTrue (f is EnumMirror);
+		Assert.AreEqual (1, (f as EnumMirror).Value);
+		Assert.AreEqual ("B", (f as EnumMirror).StringValue);
+
+		// Inherited object fields
+		TypeMirror parent = t.BaseType;
+		f = o.GetValue (parent.GetField ("base_field_i"));
+		AssertValue (43, f);
+		f = o.GetValue (parent.GetField ("base_field_s"));
+		AssertValue ("T", f);
+
+		// Static fields
+		f = o.GetValue (o.Type.GetField ("static_i"));
+		AssertValue (55, f);
+
+		// generic instances
+		ObjectMirror o2 = frame.GetValue (frame.Method.GetParameters ()[1]) as ObjectMirror;
+		Assert.AreEqual ("GClass`1", o2.Type.Name);
+		TypeMirror t2 = o2.Type;
+		f = o2.GetValue (t2.GetField ("field"));
+		AssertValue (42, f);
+
+		ObjectMirror o3 = frame.GetValue (frame.Method.GetParameters ()[2]) as ObjectMirror;
+		Assert.AreEqual ("GClass`1", o3.Type.Name);
+		TypeMirror t3 = o3.Type;
+		f = o3.GetValue (t3.GetField ("field"));
+		AssertValue ("FOO", f);
+
+		// Argument checking
+		AssertThrows<ArgumentNullException> (delegate () {
+			o.GetValue (null);
+			});
+	}
+
+	[Test]
+	public void Object_GetValues () {
+		var e = run_until ("o1");
+		var frame = e.Thread.GetFrames () [0];
+
+		object val = frame.GetThis ();
+		Assert.IsTrue (val is ObjectMirror);
+		Assert.AreEqual ("Tests", (val as ObjectMirror).Type.Name);
+		ObjectMirror o = (val as ObjectMirror);
+
+		ObjectMirror val2 = frame.GetValue (frame.Method.GetParameters ()[0]) as ObjectMirror;
+
+		TypeMirror t = o.Type;
+
+		object[] vals = o.GetValues (new FieldInfoMirror [] { t.GetField ("field_i"), t.GetField ("field_s") });
+		object f = vals [0];
+		AssertValue (42, f);
+		f = vals [1];
+		AssertValue ("S", f);
+
+		// Argument checking
+		AssertThrows<ArgumentNullException> (delegate () {
+			o.GetValues (null);
+			});
+
+		AssertThrows<ArgumentNullException> (delegate () {
+			o.GetValues (new FieldInfoMirror [] { null });
+			});
+
+		// field of another class
+		AssertThrows<ArgumentException> (delegate () {
+				o.GetValue (val2.Type.GetField ("field_j"));
+			});
+	}
+
+	void TestSetValue (ObjectMirror o, string field_name, object val) {
+		if (val is string)
+			o.SetValue (o.Type.GetField (field_name), vm.RootDomain.CreateString ((string)val));
+		else
+			o.SetValue (o.Type.GetField (field_name), vm.CreateValue (val));
+		Value f = o.GetValue (o.Type.GetField (field_name));
+		AssertValue (val, f);
+	}
+
+	[Test]
+	public void Object_SetValues () {
+		var e = run_until ("o1");
+		var frame = e.Thread.GetFrames () [0];
+
+		object val = frame.GetThis ();
+		Assert.IsTrue (val is ObjectMirror);
+		Assert.AreEqual ("Tests", (val as ObjectMirror).Type.Name);
+		ObjectMirror o = (val as ObjectMirror);
+
+		ObjectMirror val2 = frame.GetValue (frame.Method.GetParameters ()[0]) as ObjectMirror;
+
+		TestSetValue (o, "field_i", 22);
+		TestSetValue (o, "field_bool1", false);
+		TestSetValue (o, "field_bool2", true);
+		TestSetValue (o, "field_char", 'B');
+		TestSetValue (o, "field_byte", (byte)129);
+		TestSetValue (o, "field_sbyte", (sbyte)-33);
+		TestSetValue (o, "field_short", (short)(Int16.MaxValue - 5));
+		TestSetValue (o, "field_ushort", (ushort)(UInt16.MaxValue - 5));
+		TestSetValue (o, "field_long", Int64.MaxValue - 5);
+		TestSetValue (o, "field_ulong", (ulong)(UInt64.MaxValue - 5));
+		TestSetValue (o, "field_float", 6.28f);
+		TestSetValue (o, "field_double", 6.28);
+		TestSetValue (o, "static_i", 23);
+		TestSetValue (o, "field_s", "CDEF");
+
+		Value f;
+
+		// intptrs
+		f = o.GetValue (o.Type.GetField ("field_intptr"));
+		Assert.IsInstanceOfType (typeof (StructMirror), f);
+		AssertValue (Int32.MaxValue - 5, (f as StructMirror).Fields [0]);
+
+		// enums
+
+		FieldInfoMirror field = o.Type.GetField ("field_enum");
+		f = o.GetValue (field);
+		(f as EnumMirror).Value = 5;
+		o.SetValue (field, f);
+		f = o.GetValue (field);
+		Assert.AreEqual (5, (f as EnumMirror).Value);
+
+		// null
+		o.SetValue (o.Type.GetField ("field_s"), vm.CreateValue (null));
+		f = o.GetValue (o.Type.GetField ("field_s"));
+		AssertValue (null, f);
+
+		// vtype instances
+		field = o.Type.GetField ("generic_field_struct");
+		f = o.GetValue (field);
+		o.SetValue (field, f);
+
+		// Argument checking
+		AssertThrows<ArgumentNullException> (delegate () {
+				o.SetValues (null, new Value [0]);
+			});
+
+		AssertThrows<ArgumentNullException> (delegate () {
+				o.SetValues (new FieldInfoMirror [0], null);
+			});
+
+		AssertThrows<ArgumentNullException> (delegate () {
+				o.SetValues (new FieldInfoMirror [] { null }, new Value [1] { null });
+			});
+
+		// vtype with a wrong type
+		AssertThrows<ArgumentException> (delegate () {
+				o.SetValue (o.Type.GetField ("field_struct"), o.GetValue (o.Type.GetField ("field_enum")));
+			});
+
+		// reference type not assignment compatible
+		AssertThrows<ArgumentException> (delegate () {
+				o.SetValue (o.Type.GetField ("field_class"), o);
+			});
+
+		// field of another class
+		AssertThrows<ArgumentException> (delegate () {
+				o.SetValue (val2.Type.GetField ("field_j"), vm.CreateValue (1));
+			});
+	}
+
+	[Test]
+	[Category ("only")]
+	public void Type_SetValue () {
+		var e = run_until ("o1");
+		var frame = e.Thread.GetFrames () [0];
+		Value f;
+
+		object val = frame.GetThis ();
+		Assert.IsTrue (val is ObjectMirror);
+		Assert.AreEqual ("Tests", (val as ObjectMirror).Type.Name);
+		ObjectMirror o = (val as ObjectMirror);
+
+		ObjectMirror val2 = frame.GetValue (frame.Method.GetParameters ()[0]) as ObjectMirror;
+
+		o.Type.SetValue (o.Type.GetField ("static_i"), vm.CreateValue (55));
+		f = o.Type.GetValue (o.Type.GetField ("static_i"));
+		AssertValue (55, f);
+
+		o.Type.SetValue (o.Type.GetField ("static_s"), vm.RootDomain.CreateString ("B"));
+		f = o.Type.GetValue (o.Type.GetField ("static_s"));
+		AssertValue ("B", f);
+
+		// Argument checking
+		AssertThrows<ArgumentNullException> (delegate () {
+				o.Type.SetValue (null, vm.CreateValue (0));
+			});
+
+		AssertThrows<ArgumentNullException> (delegate () {
+				o.Type.SetValue (o.Type.GetField ("static_i"), null);
+			});
+
+		// field of another class
+		AssertThrows<ArgumentException> (delegate () {
+				o.SetValue (val2.Type.GetField ("field_j"), vm.CreateValue (1));
+			});
+	}
+
+	[Test]
+	public void TypeInfo () {
+		Event e = run_until ("ti2");
+		StackFrame frame = e.Thread.GetFrames () [0];
+
+		TypeMirror t;
+
+		// Array types
+		t = frame.Method.GetParameters ()[0].ParameterType;
+
+		Assert.AreEqual ("String[]", t.Name);
+		Assert.AreEqual ("string[]", t.CSharpName);
+		Assert.AreEqual ("Array", t.BaseType.Name);
+		Assert.AreEqual (true, t.HasElementType);
+		Assert.AreEqual (true, t.IsArray);
+		Assert.AreEqual (1, t.GetArrayRank ());
+		Assert.AreEqual ("String", t.GetElementType ().Name);
+
+		t = frame.Method.GetParameters ()[2].ParameterType;
+
+		Assert.AreEqual ("Int32[,]", t.Name);
+		// FIXME:
+		//Assert.AreEqual ("int[,]", t.CSharpName);
+		Assert.AreEqual ("Array", t.BaseType.Name);
+		Assert.AreEqual (true, t.HasElementType);
+		Assert.AreEqual (true, t.IsArray);
+		Assert.AreEqual (2, t.GetArrayRank ());
+		Assert.AreEqual ("Int32", t.GetElementType ().Name);
+
+		// Byref types
+		t = frame.Method.GetParameters ()[3].ParameterType;
+		// FIXME:
+		//Assert.AreEqual ("Int32&", t.Name);
+		//Assert.AreEqual (true, t.IsByRef);
+		//Assert.AreEqual (true, t.HasElementType);
+
+		// Pointer types
+		t = frame.Method.GetParameters ()[4].ParameterType;
+		// FIXME:
+		//Assert.AreEqual ("Int32*", t.Name);
+		Assert.AreEqual (true, t.IsPointer);
+		Assert.AreEqual (true, t.HasElementType);
+		Assert.AreEqual ("Int32", t.GetElementType ().Name);
+		Assert.AreEqual (false, t.IsPrimitive);
+
+		// primitive types 
+		t = frame.Method.GetParameters ()[5].ParameterType;
+		Assert.AreEqual (true, t.IsPrimitive);
+
+		// value types
+		t = frame.Method.GetParameters ()[6].ParameterType;
+		Assert.AreEqual ("AStruct", t.Name);
+		Assert.AreEqual (false, t.IsPrimitive);
+		Assert.AreEqual (true, t.IsValueType);
+		Assert.AreEqual (false, t.IsClass);
+
+		// reference types
+		t = frame.Method.GetParameters ()[7].ParameterType;
+		Assert.AreEqual ("Tests", t.Name);
+		var nested = (from nt in t.GetNestedTypes () where nt.IsNestedPublic select nt).ToArray ();
+		Assert.AreEqual (1, nested.Length);
+		Assert.AreEqual ("NestedClass", nested [0].Name);
+		Assert.IsTrue (t.BaseType.IsAssignableFrom (t));
+		Assert.IsTrue (!t.IsAssignableFrom (t.BaseType));
+
+		// generic instances
+		t = frame.Method.GetParameters ()[9].ParameterType;
+		Assert.AreEqual ("GClass`1", t.Name);
+
+		// enums
+		t = frame.Method.GetParameters ()[10].ParameterType;
+		Assert.AreEqual ("AnEnum", t.Name);
+		Assert.IsTrue (t.IsEnum);
+		Assert.AreEqual ("Int32", t.EnumUnderlyingType.Name);
+
+		// properties
+		t = frame.Method.GetParameters ()[7].ParameterType;
+
+		var props = t.GetProperties ();
+		Assert.AreEqual (3, props.Length);
+		foreach (PropertyInfoMirror prop in props) {
+			ParameterInfoMirror[] indexes = prop.GetIndexParameters ();
+
+			if (prop.Name == "IntProperty") {
+				Assert.AreEqual ("Int32", prop.PropertyType.Name);
+				Assert.AreEqual ("get_IntProperty", prop.GetGetMethod ().Name);
+				Assert.AreEqual ("set_IntProperty", prop.GetSetMethod ().Name);
+				Assert.AreEqual (0, indexes.Length);
+			} else if (prop.Name == "ReadOnlyProperty") {
+				Assert.AreEqual ("Int32", prop.PropertyType.Name);
+				Assert.AreEqual ("get_ReadOnlyProperty", prop.GetGetMethod ().Name);
+				Assert.AreEqual (null, prop.GetSetMethod ());
+				Assert.AreEqual (0, indexes.Length);
+			} else if (prop.Name == "IndexedProperty") {
+				Assert.AreEqual (1, indexes.Length);
+				Assert.AreEqual ("Int32", indexes [0].ParameterType.Name);
+			}
+		}
+
+		// custom attributes
+		t = frame.Method.GetParameters ()[8].ParameterType;
+		Assert.AreEqual ("Tests2", t.Name);
+		var attrs = t.GetCustomAttributes (true);
+		Assert.AreEqual (2, attrs.Length);
+		foreach (var attr in attrs) {
+			if (attr.Constructor.DeclaringType.Name == "DebuggerDisplayAttribute") {
+				Assert.AreEqual (1, attr.ConstructorArguments.Count);
+				Assert.AreEqual ("Tests", attr.ConstructorArguments [0].Value);
+				Assert.AreEqual (2, attr.NamedArguments.Count);
+				Assert.AreEqual ("Name", attr.NamedArguments [0].Property.Name);
+				Assert.AreEqual ("FOO", attr.NamedArguments [0].TypedValue.Value);
+				Assert.AreEqual ("Target", attr.NamedArguments [1].Property.Name);
+				Assert.IsInstanceOfType (typeof (TypeMirror), attr.NamedArguments [1].TypedValue.Value);
+				Assert.AreEqual ("Int32", (attr.NamedArguments [1].TypedValue.Value as TypeMirror).Name);
+			} else if (attr.Constructor.DeclaringType.Name == "DebuggerTypeProxyAttribute") {
+				Assert.AreEqual (1, attr.ConstructorArguments.Count);
+				Assert.IsInstanceOfType (typeof (TypeMirror), attr.ConstructorArguments [0].Value);
+				Assert.AreEqual ("Tests", (attr.ConstructorArguments [0].Value as TypeMirror).Name);
+			} else {
+				Assert.Fail (attr.Constructor.DeclaringType.Name);
+			}
+		}
+	}
+
+	[Test]
+	public void FieldInfo () {
+		Event e = run_until ("ti2");
+		StackFrame frame = e.Thread.GetFrames () [0];
+
+		TypeMirror t;
+
+		t = frame.Method.GetParameters ()[8].ParameterType;
+		Assert.AreEqual ("Tests2", t.Name);
+
+		var fi = t.GetField ("field_j");
+		var attrs = fi.GetCustomAttributes (true);
+		Assert.AreEqual (1, attrs.Length);
+		var attr = attrs [0];
+		Assert.AreEqual ("DebuggerBrowsableAttribute", attr.Constructor.DeclaringType.Name);
+		Assert.AreEqual (1, attr.ConstructorArguments.Count);
+		Assert.IsInstanceOfType (typeof (EnumMirror), attr.ConstructorArguments [0].Value);
+		Assert.AreEqual ((int)System.Diagnostics.DebuggerBrowsableState.Collapsed, (attr.ConstructorArguments [0].Value as EnumMirror).Value);
+	}
+
+	[Test]
+	public void PropertyInfo () {
+		Event e = run_until ("ti2");
+		StackFrame frame = e.Thread.GetFrames () [0];
+
+		TypeMirror t;
+
+		t = frame.Method.GetParameters ()[8].ParameterType;
+		Assert.AreEqual ("Tests2", t.Name);
+
+		var pi = t.GetProperty ("AProperty");
+		var attrs = pi.GetCustomAttributes (true);
+		Assert.AreEqual (1, attrs.Length);
+		var attr = attrs [0];
+		Assert.AreEqual ("DebuggerBrowsableAttribute", attr.Constructor.DeclaringType.Name);
+		Assert.AreEqual (1, attr.ConstructorArguments.Count);
+		Assert.IsInstanceOfType (typeof (EnumMirror), attr.ConstructorArguments [0].Value);
+		Assert.AreEqual ((int)System.Diagnostics.DebuggerBrowsableState.Collapsed, (attr.ConstructorArguments [0].Value as EnumMirror).Value);
+	}
+
+	[Test]
+	public void Type_GetValue () {
+		Event e = run_until ("o1");
+		StackFrame frame = e.Thread.GetFrames () [0];
+
+		ObjectMirror o = (frame.GetThis () as ObjectMirror);
+
+		TypeMirror t = o.Type;
+
+		ObjectMirror val2 = frame.GetValue (frame.Method.GetParameters ()[0]) as ObjectMirror;
+
+		// static fields
+		object f = t.GetValue (o.Type.GetField ("static_i"));
+		AssertValue (55, f);
+
+		f = t.GetValue (o.Type.GetField ("static_s"));
+		AssertValue ("A", f);
+
+		// literal static fields
+		f = t.GetValue (o.Type.GetField ("literal_i"));
+		AssertValue (56, f);
+
+		f = t.GetValue (o.Type.GetField ("literal_s"));
+		AssertValue ("B", f);
+
+		// Inherited static fields
+		TypeMirror parent = t.BaseType;
+		f = t.GetValue (parent.GetField ("base_static_i"));
+		AssertValue (57, f);
+
+		f = t.GetValue (parent.GetField ("base_static_s"));
+		AssertValue ("C", f);
+
+		// Argument checking
+		AssertThrows<ArgumentNullException> (delegate () {
+			t.GetValue (null);
+			});
+
+		// instance fields
+		AssertThrows<ArgumentException> (delegate () {
+			t.GetValue (o.Type.GetField ("field_i"));
+			});
+
+		// field on another type
+		AssertThrows<ArgumentException> (delegate () {
+				t.GetValue (val2.Type.GetField ("static_field_j"));
+			});
+
+		// special static field
+		AssertThrows<ArgumentException> (delegate () {
+				t.GetValue (t.GetField ("tls_i"));
+			});
+	}
+
+	[Test]
+	public void Type_GetValues () {
+		Event e = run_until ("o1");
+		StackFrame frame = e.Thread.GetFrames () [0];
+
+		ObjectMirror o = (frame.GetThis () as ObjectMirror);
+
+		TypeMirror t = o.Type;
+
+		// static fields
+		object[] vals = t.GetValues (new FieldInfoMirror [] { t.GetField ("static_i"), t.GetField ("static_s") });
+		object f = vals [0];
+		AssertValue (55, f);
+
+		f = vals [1];
+		AssertValue ("A", f);
+
+		// Argument checking
+		AssertThrows<ArgumentNullException> (delegate () {
+			t.GetValues (null);
+			});
+
+		AssertThrows<ArgumentNullException> (delegate () {
+			t.GetValues (new FieldInfoMirror [] { null });
+			});
+	}
+
+	[Test]
+	public void ObjRefs () {
+		Event e = run_until ("objrefs1");
+		StackFrame frame = e.Thread.GetFrames () [0];
+
+		ObjectMirror o = frame.GetThis () as ObjectMirror;
+		ObjectMirror child = o.GetValue (o.Type.GetField ("child")) as ObjectMirror;
+
+		Assert.IsTrue (child.Address > 0);
+
+		// Check that object references are internalized correctly
+		Assert.AreEqual (o, frame.GetThis ());
+
+		run_until ("objrefs2");
+
+		// child should be gc'd now
+		Assert.IsTrue (child.IsCollected);
+
+		AssertThrows<ObjectCollectedException> (delegate () {
+			TypeMirror t = child.Type;
+			});
+
+		AssertThrows<ObjectCollectedException> (delegate () {
+				long addr = child.Address;
+			});
+	}
+
+	[Test]
+	public void Type_GetObject () {
+		Event e = run_until ("o1");
+		StackFrame frame = e.Thread.GetFrames () [0];
+
+		ObjectMirror o = (frame.GetThis () as ObjectMirror);
+
+		TypeMirror t = o.Type;
+
+		Assert.AreEqual ("MonoType", t.GetTypeObject ().Type.Name);
+	}
+
+	[Test]
+	public void VTypes () {
+		Event e = run_until ("vtypes1");
+		StackFrame frame = e.Thread.GetFrames () [0];
+
+		// vtypes as fields
+		ObjectMirror o = frame.GetThis () as ObjectMirror;
+		var obj = o.GetValue (o.Type.GetField ("field_struct"));
+		Assert.IsTrue (obj is StructMirror);
+		var s = obj as StructMirror;
+		Assert.AreEqual ("AStruct", s.Type.Name);
+		AssertValue (42, s ["i"]);
+		obj = s ["s"];
+		AssertValue ("S", obj);
+		AssertValue (43, s ["k"]);
+		obj = o.GetValue (o.Type.GetField ("field_boxed_struct"));
+		Assert.IsTrue (obj is StructMirror);
+		s = obj as StructMirror;
+		Assert.AreEqual ("AStruct", s.Type.Name);
+		AssertValue (42, s ["i"]);
+
+		// vtypes as arguments
+		s = frame.GetArgument (0) as StructMirror;
+		AssertValue (44, s ["i"]);
+		obj = s ["s"];
+		AssertValue ("T", obj);
+		AssertValue (45, s ["k"]);
+
+		// vtypes as array entries
+		var arr = frame.GetArgument (1) as ArrayMirror;
+		obj = arr [0];
+		Assert.IsTrue (obj is StructMirror);
+		s = obj as StructMirror;
+		AssertValue (1, s ["i"]);
+		AssertValue ("S1", s ["s"]);
+		obj = arr [1];
+		Assert.IsTrue (obj is StructMirror);
+		s = obj as StructMirror;
+		AssertValue (2, s ["i"]);
+		AssertValue ("S2", s ["s"]);
+
+		// Argument checking
+		s = frame.GetArgument (0) as StructMirror;
+		AssertThrows<ArgumentException> (delegate () {
+				obj = s ["FOO"];
+			});
+
+		// generic vtype instances
+		o = frame.GetThis () as ObjectMirror;
+		obj = o.GetValue (o.Type.GetField ("generic_field_struct"));
+		Assert.IsTrue (obj is StructMirror);
+		s = obj as StructMirror;
+		Assert.AreEqual ("GStruct`1", s.Type.Name);
+		AssertValue (42, s ["i"]);
+
+		// this on vtype methods
+		e = run_until ("vtypes2");
+		
+		e = single_step (e.Thread);
+
+		frame = e.Thread.GetFrames () [0];
+
+		Assert.AreEqual ("foo", (e as StepEvent).Method.Name);
+		obj = frame.GetThis ();
+
+		Assert.IsTrue (obj is StructMirror);
+		s = obj as StructMirror;
+		AssertValue (44, s ["i"]);
+		AssertValue ("T", s ["s"]);
+		AssertValue (45, s ["k"]);
+
+		// this on static vtype methods
+		e = run_until ("vtypes3");
+
+		e = single_step (e.Thread);
+
+		frame = e.Thread.GetFrames () [0];
+
+		Assert.AreEqual ("static_foo", (e as StepEvent).Method.Name);
+		obj = frame.GetThis ();
+		AssertValue (null, obj);
+	}
+
+	[Test]
+	public void AssemblyInfo () {
+		Event e = run_until ("single_stepping");
+
+		StackFrame frame = e.Thread.GetFrames () [0];
+
+		var aname = frame.Method.DeclaringType.Assembly.GetName ();
+		Assert.AreEqual ("dtest-app, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", aname.ToString ());
+
+		ModuleMirror m = frame.Method.DeclaringType.Module;
+
+		Assert.AreEqual ("dtest-app.exe", m.Name);
+		Assert.AreEqual ("dtest-app.exe", m.ScopeName);
+		Assert.IsTrue (m.FullyQualifiedName.IndexOf ("dtest-app.exe") != -1);
+		Guid guid = m.ModuleVersionId;
+		Assert.AreEqual (frame.Method.DeclaringType.Assembly, m.Assembly);
+		Assert.AreEqual (frame.Method.DeclaringType.Assembly.ManifestModule, m);
+
+		Assert.AreEqual ("Assembly", frame.Method.DeclaringType.Assembly.GetAssemblyObject ().Type.Name);
+
+		TypeMirror t = vm.RootDomain.Corlib.GetType ("System.Diagnostics.DebuggerDisplayAttribute");
+		Assert.AreEqual ("DebuggerDisplayAttribute", t.Name);
+	}
+
+	[Test]
+	public void LocalsInfo () {
+		Event e = run_until ("locals2");
+
+		StackFrame frame = e.Thread.GetFrames () [0];
+
+		var locals = frame.Method.GetLocals ();
+		Assert.AreEqual (5, locals.Length);
+		for (int i = 0; i < 5; ++i) {
+			if (locals [i].Name == "args") {
+				Assert.IsTrue (locals [i].IsArg);
+				Assert.AreEqual ("String[]", locals [i].Type.Name);
+			} else if (locals [i].Name == "arg") {
+				Assert.IsTrue (locals [i].IsArg);
+				Assert.AreEqual ("Int32", locals [i].Type.Name);
+			} else if (locals [i].Name == "i") {
+				Assert.IsFalse (locals [i].IsArg);
+				Assert.AreEqual ("Int64", locals [i].Type.Name);
+			} else if (locals [i].Name == "j") {
+				Assert.IsFalse (locals [i].IsArg);
+				Assert.AreEqual ("Int32", locals [i].Type.Name);
+			} else if (locals [i].Name == "s") {
+				Assert.IsFalse (locals [i].IsArg);
+				Assert.AreEqual ("String", locals [i].Type.Name);
+			} else {
+				Assert.Fail ();
+			}
+		}
+	}
+
+	[Test]
+	public void Locals () {
+		var be = run_until ("locals1");
+
+		StackFrame frame = be.Thread.GetFrames () [0];
+
+		MethodMirror m1 = frame.Method;
+
+		be = run_until ("locals2");
+
+		frame = be.Thread.GetFrames () [0];
+
+		object val = frame.GetValue (frame.Method.GetLocal ("i"));
+		AssertValue (0, val);
+
+		// Execute i = 42
+		var req = vm.CreateStepRequest (be.Thread);
+		req.Enable ();
+
+		vm.Resume ();
+		var e = vm.GetNextEvent ();
+		Assert.IsTrue (e is StepEvent);
+		Assert.AreEqual ("locals2", (e as StepEvent).Method.Name);
+
+		// Execute s = "AB";
+		vm.Resume ();
+		e = vm.GetNextEvent ();
+		Assert.IsTrue (e is StepEvent);
+		Assert.AreEqual ("locals2", (e as StepEvent).Method.Name);
+
+		frame = e.Thread.GetFrames () [0];
+
+		val = frame.GetValue (frame.Method.GetLocal ("i"));
+		AssertValue (42, val);
+
+		LocalVariable[] locals = frame.Method.GetLocals ();
+		var vals = frame.GetValues (locals);
+		Assert.AreEqual (locals.Length, vals.Length);
+		for (int i = 0; i < locals.Length; ++i) {
+			if (locals [i].Name == "i")
+				AssertValue (42, vals [i]);
+			if (locals [i].Name == "s")
+				AssertValue ("AB", vals [i]);
+		}
+
+		// Argument checking
+
+		// GetValue () null
+		AssertThrows<ArgumentNullException> (delegate () {
+				frame.GetValue ((LocalVariable)null);
+			});
+		// GetValue () local from another method
+		AssertThrows<ArgumentException> (delegate () {
+				frame.GetValue (m1.GetLocal ("foo"));
+			});
+
+		// GetValue () null
+		AssertThrows<ArgumentNullException> (delegate () {
+				frame.GetValue ((ParameterInfoMirror)null);
+			});
+		// GetValue () local from another method
+		AssertThrows<ArgumentException> (delegate () {
+				frame.GetValue (m1.GetParameters ()[0]);
+			});
+
+		// GetValues () null
+		AssertThrows<ArgumentNullException> (delegate () {
+				frame.GetValues (null);
+			});
+		// GetValues () embedded null
+		AssertThrows<ArgumentNullException> (delegate () {
+				frame.GetValues (new LocalVariable [] { null });
+			});
+		// GetValues () local from another method
+		AssertThrows<ArgumentException> (delegate () {
+				frame.GetValues (new LocalVariable [] { m1.GetLocal ("foo") });
+			});
+		// return value
+		AssertThrows<ArgumentException> (delegate () {
+				val = frame.GetValue (frame.Method.ReturnParameter);
+			});
+
+		// invalid stack frames
+		vm.Resume ();
+		e = vm.GetNextEvent ();
+		Assert.IsTrue (e is StepEvent);
+		Assert.AreEqual ("locals2", (e as StepEvent).Method.Name);
+
+		AssertThrows<InvalidStackFrameException> (delegate () {
+				frame.GetValue (frame.Method.GetLocal ("i"));
+			});
+
+		req.Disable ();
+	}
+
+	[Test]
+	public void GetVisibleVariables () {
+		Event e = run_until ("locals4");
+
+		// First scope
+		var locals = e.Thread.GetFrames ()[1].GetVisibleVariables ();
+		Assert.AreEqual (2, locals.Count);
+		var loc = locals.First (l => l.Name == "i");
+		Assert.AreEqual ("Int64", loc.Type.Name);
+		loc = locals.First (l => l.Name == "s");
+		Assert.AreEqual ("String", loc.Type.Name);
+
+		loc = e.Thread.GetFrames ()[1].GetVisibleVariableByName ("i");
+		Assert.AreEqual ("i", loc.Name);
+		Assert.AreEqual ("Int64", loc.Type.Name);
+
+		e = run_until ("locals5");
+
+		// Second scope
+		locals = e.Thread.GetFrames ()[1].GetVisibleVariables ();
+		Assert.AreEqual (2, locals.Count);
+		loc = locals.First (l => l.Name == "i");
+		Assert.AreEqual ("String", loc.Type.Name);
+		loc = locals.First (l => l.Name == "s");
+		Assert.AreEqual ("String", loc.Type.Name);
+
+		loc = e.Thread.GetFrames ()[1].GetVisibleVariableByName ("i");
+		Assert.AreEqual ("i", loc.Name);
+		Assert.AreEqual ("String", loc.Type.Name);
+
+		// Variable in another scope
+		loc = e.Thread.GetFrames ()[1].GetVisibleVariableByName ("j");
+		Assert.IsNull (loc);
+	}
+
+	[Test]
+	public void Exit () {
+		run_until ("Main");
+
+		vm.Exit (5);
+
+		var e = vm.GetNextEvent ();
+		Assert.IsInstanceOfType (typeof (VMDeathEvent), e);
+
+		var p = vm.Process;
+		/* Could be a remote vm with no process */
+		if (p != null) {
+			p.WaitForExit ();
+			Assert.AreEqual (5, p.ExitCode);
+
+			// error handling
+			AssertThrows<VMDisconnectedException> (delegate () {
+					vm.Resume ();
+				});
+		}
+
+		vm = null;
+	}
+
+	[Test]
+	public void Dispose () {
+		run_until ("Main");
+
+		vm.Dispose ();
+
+		var e = vm.GetNextEvent ();
+		Assert.IsInstanceOfType (typeof (VMDisconnectEvent), e);
+
+		var p = vm.Process;
+		/* Could be a remote vm with no process */
+		if (p != null) {
+			p.WaitForExit ();
+			Assert.AreEqual (3, p.ExitCode);
+
+			// error handling
+			AssertThrows<VMDisconnectedException> (delegate () {
+					vm.Resume ();
+				});
+		}
+
+		vm = null;
+	}
+
+	[Test]
+	public void LineNumbers () {
+		Event e = run_until ("line_numbers");
+
+		step_req = vm.CreateStepRequest (e.Thread);
+		step_req.Depth = StepDepth.Into;
+		step_req.Enable ();
+
+		Location l;
+		
+		vm.Resume ();
+
+		e = vm.GetNextEvent ();
+		Assert.IsTrue (e is StepEvent);
+
+		l = e.Thread.GetFrames ()[0].Location;
+
+		Assert.IsTrue (l.SourceFile.IndexOf ("dtest-app.cs") != -1);
+		Assert.AreEqual ("ln1", l.Method.Name);
+		
+		int line_base = l.LineNumber;
+
+		vm.Resume ();
+		e = vm.GetNextEvent ();
+		Assert.IsTrue (e is StepEvent);
+		l = e.Thread.GetFrames ()[0].Location;
+		Assert.AreEqual ("ln2", l.Method.Name);
+		Assert.AreEqual (line_base + 6, l.LineNumber);
+
+		vm.Resume ();
+		e = vm.GetNextEvent ();
+		Assert.IsTrue (e is StepEvent);
+		l = e.Thread.GetFrames ()[0].Location;
+		Assert.AreEqual ("ln1", l.Method.Name);
+		Assert.AreEqual (line_base + 1, l.LineNumber);
+
+		vm.Resume ();
+		e = vm.GetNextEvent ();
+		Assert.IsTrue (e is StepEvent);
+		l = e.Thread.GetFrames ()[0].Location;
+		Assert.AreEqual ("ln3", l.Method.Name);
+		Assert.AreEqual (line_base + 10, l.LineNumber);
+
+		vm.Resume ();
+		e = vm.GetNextEvent ();
+		Assert.IsTrue (e is StepEvent);
+		l = e.Thread.GetFrames ()[0].Location;
+		Assert.AreEqual ("ln1", l.Method.Name);
+		Assert.AreEqual (line_base + 2, l.LineNumber);
+
+		// GetSourceFiles ()
+		string[] sources = l.Method.DeclaringType.GetSourceFiles ();
+		Assert.AreEqual (1, sources.Length);
+		Assert.AreEqual ("dtest-app.cs", sources [0]);
+
+		sources = l.Method.DeclaringType.GetSourceFiles (true);
+		Assert.AreEqual (1, sources.Length);
+		Assert.IsTrue (sources [0].EndsWith ("dtest-app.cs"));
+	}
+
+	[Test]
+	public void Suspend () {
+		vm.Dispose ();
+
+		Start (new string [] { "dtest-app.exe", "suspend-test" });
+
+		Event e = run_until ("suspend");
+
+		ThreadMirror main = e.Thread;
+
+		vm.Resume ();
+
+		Thread.Sleep (100);
+
+		vm.Suspend ();
+
+		// The debuggee should be suspended while it is running the infinite loop
+		// in suspend ()
+		StackFrame frame = main.GetFrames ()[0];
+		Assert.AreEqual ("suspend", frame.Method.Name);
+
+		vm.Resume ();
+
+		// resuming when not suspended
+		AssertThrows<InvalidOperationException> (delegate () {
+				vm.Resume ();
+			});
+
+		vm.Exit (0);
+
+		vm = null;
+	}
+
+	[Test]
+	public void AssemblyLoad () {
+		Event e = run_until ("assembly_load");
+
+		vm.Resume ();
+
+		e = vm.GetNextEvent ();
+		Assert.IsInstanceOfType (typeof (AssemblyLoadEvent), e);
+		Assert.IsTrue ((e as AssemblyLoadEvent).Assembly.Location.EndsWith ("System.dll"));
+
+		var frames = e.Thread.GetFrames ();
+		Assert.IsTrue (frames.Length > 0);
+		Assert.AreEqual ("assembly_load", frames [0].Method.Name);
+	}
+
+	[Test]
+	public void CreateValue () {
+		PrimitiveValue v;
+
+		v = vm.CreateValue (1);
+		Assert.AreEqual (vm, v.VirtualMachine);
+		Assert.AreEqual (1, v.Value);
+
+		v = vm.CreateValue (null);
+		Assert.AreEqual (vm, v.VirtualMachine);
+		Assert.AreEqual (null, v.Value);
+
+		// Argument checking
+		AssertThrows <ArgumentException> (delegate () {
+				v = vm.CreateValue ("FOO");
+			});
+	}
+
+	[Test]
+	public void CreateString () {
+		StringMirror s = vm.RootDomain.CreateString ("ABC");
+
+		Assert.AreEqual (vm, s.VirtualMachine);
+		Assert.AreEqual ("ABC", s.Value);
+		Assert.AreEqual (vm.RootDomain, s.Domain);
+
+		// Argument checking
+		AssertThrows <ArgumentNullException> (delegate () {
+				s = vm.RootDomain.CreateString (null);
+			});
+	}
+
+	[Test]
+	[Category ("only")]
+	public void CreateBoxedValue () {
+		ObjectMirror o = vm.RootDomain.CreateBoxedValue (new PrimitiveValue (vm, 42));
+
+		Assert.AreEqual ("Int32", o.Type.Name);
+		//AssertValue (42, m.GetValue (o.Type.GetField ("m_value")));
+
+		// Argument checking
+		AssertThrows <ArgumentNullException> (delegate () {
+				vm.RootDomain.CreateBoxedValue (null);
+			});
+
+		AssertThrows <ArgumentException> (delegate () {
+				vm.RootDomain.CreateBoxedValue (o);
+			});
+	}
+
+	[Test]
+	public void Invoke () {
+		Event e = run_until ("invoke1");
+
+		StackFrame frame = e.Thread.GetFrames () [0];
+
+		TypeMirror t = frame.Method.DeclaringType;
+		ObjectMirror this_obj = (ObjectMirror)frame.GetThis ();
+
+		TypeMirror t2 = frame.Method.GetParameters ()[0].ParameterType;
+
+		MethodMirror m;
+		Value v;
+
+		// return void
+		m = t.GetMethod ("invoke_return_void");
+		v = this_obj.InvokeMethod (e.Thread, m, null);
+		Assert.IsNull (v);
+
+		// return ref
+		m = t.GetMethod ("invoke_return_ref");
+		v = this_obj.InvokeMethod (e.Thread, m, null);
+		AssertValue ("ABC", v);
+
+		// return null
+		m = t.GetMethod ("invoke_return_null");
+		v = this_obj.InvokeMethod (e.Thread, m, null);
+		AssertValue (null, v);
+
+		// return primitive
+		m = t.GetMethod ("invoke_return_primitive");
+		v = this_obj.InvokeMethod (e.Thread, m, null);
+		AssertValue (42, v);
+
+		// pass primitive
+		m = t.GetMethod ("invoke_pass_primitive");
+		Value[] args = new Value [] {
+			vm.CreateValue ((byte)Byte.MaxValue),
+			vm.CreateValue ((sbyte)SByte.MaxValue),
+			vm.CreateValue ((short)1),
+			vm.CreateValue ((ushort)1),
+			vm.CreateValue ((int)1),
+			vm.CreateValue ((uint)1),
+			vm.CreateValue ((long)1),
+			vm.CreateValue ((ulong)1),
+			vm.CreateValue ('A'),
+			vm.CreateValue (true),
+			vm.CreateValue (3.14f),
+			vm.CreateValue (3.14) };
+
+		v = this_obj.InvokeMethod (e.Thread, m, args);
+		AssertValue ((int)Byte.MaxValue + (int)SByte.MaxValue + 1 + 1 + 1 + 1 + 1 + 1 + 'A' + 1 + 3 + 3, v);
+
+		// pass ref
+		m = t.GetMethod ("invoke_pass_ref");
+		v = this_obj.InvokeMethod (e.Thread, m, new Value [] { vm.RootDomain.CreateString ("ABC") });
+		AssertValue ("ABC", v);
+
+		// pass null
+		m = t.GetMethod ("invoke_pass_ref");
+		v = this_obj.InvokeMethod (e.Thread, m, new Value [] { vm.CreateValue (null) });
+		AssertValue (null, v);
+
+		// static
+		m = t.GetMethod ("invoke_static_pass_ref");
+		v = t.InvokeMethod (e.Thread, m, new Value [] { vm.RootDomain.CreateString ("ABC") });
+		AssertValue ("ABC", v);
+
+		// static invoked using ObjectMirror.InvokeMethod
+		m = t.GetMethod ("invoke_static_pass_ref");
+		v = this_obj.InvokeMethod (e.Thread, m, new Value [] { vm.RootDomain.CreateString ("ABC") });
+		AssertValue ("ABC", v);
+
+		// method which throws an exception
+		try {
+			m = t.GetMethod ("invoke_throws");
+			v = this_obj.InvokeMethod (e.Thread, m, null);
+			Assert.Fail ();
+		} catch (InvocationException ex) {
+			Assert.AreEqual ("Exception", ex.Exception.Type.Name);
+		}
+
+		// newobj
+		m = t.GetMethod (".ctor");
+		v = t.InvokeMethod (e.Thread, m, null);
+		Assert.IsInstanceOfType (typeof (ObjectMirror), v);
+		Assert.AreEqual ("Tests", (v as ObjectMirror).Type.Name);
+
+		// Argument checking
+		
+		// null thread
+		AssertThrows<ArgumentNullException> (delegate {
+				m = t.GetMethod ("invoke_pass_ref");
+				v = this_obj.InvokeMethod (null, m, new Value [] { vm.CreateValue (null) });				
+			});
+
+		// null method
+		AssertThrows<ArgumentNullException> (delegate {
+				v = this_obj.InvokeMethod (e.Thread, null, new Value [] { vm.CreateValue (null) });				
+			});
+
+		// invalid number of arguments
+		m = t.GetMethod ("invoke_pass_ref");
+		AssertThrows<ArgumentException> (delegate {
+				v = this_obj.InvokeMethod (e.Thread, m, null);
+			});
+
+		// invalid type of argument (ref != primitive)
+		m = t.GetMethod ("invoke_pass_ref");
+		AssertThrows<ArgumentException> (delegate {
+				v = this_obj.InvokeMethod (e.Thread, m, new Value [] { vm.CreateValue (1) });
+			});
+
+		// invalid type of argument (primitive != primitive)
+		m = t.GetMethod ("invoke_pass_primitive_2");
+		AssertThrows<ArgumentException> (delegate {
+				v = this_obj.InvokeMethod (e.Thread, m, new Value [] { vm.CreateValue (1) });
+			});
+
+		// invoking a non-static method as static
+		m = t.GetMethod ("invoke_pass_ref");
+		AssertThrows<ArgumentException> (delegate {
+				v = t.InvokeMethod (e.Thread, m, new Value [] { vm.RootDomain.CreateString ("ABC") });
+			});
+
+		// invoking a method defined in another class
+		m = t2.GetMethod ("invoke");
+		AssertThrows<ArgumentException> (delegate {
+				v = this_obj.InvokeMethod (e.Thread, m, null);
+			});
+	}
+
+	[Test]
+	public void InvokeVType () {
+		Event e = run_until ("invoke1");
+
+		StackFrame frame = e.Thread.GetFrames () [0];
+
+		var s = frame.GetArgument (1) as StructMirror;
+
+		TypeMirror t = s.Type;
+
+		MethodMirror m;
+		Value v;
+
+		// Pass struct as this, receive int
+		m = t.GetMethod ("invoke_return_int");
+		v = s.InvokeMethod (e.Thread, m, null);
+		AssertValue (42, v);
+
+		// Pass struct as this, receive intptr
+		m = t.GetMethod ("invoke_return_intptr");
+		v = s.InvokeMethod (e.Thread, m, null);
+		AssertValue (43, v);
+
+		// Static method
+		m = t.GetMethod ("invoke_static");
+		v = t.InvokeMethod (e.Thread, m, null);
+		AssertValue (5, v);
+
+		// Pass generic struct as this
+		s = frame.GetArgument (2) as StructMirror;
+		t = s.Type;
+		m = t.GetMethod ("invoke_return_int");
+		v = s.InvokeMethod (e.Thread, m, null);
+		AssertValue (42, v);
+	}
+
+	[Test]
+	public void BreakpointDuringInvoke () {
+		Event e = run_until ("invoke1");
+
+		MethodMirror m = entry_point.DeclaringType.GetMethod ("invoke2");
+		Assert.IsNotNull (m);
+		vm.SetBreakpoint (m, 0);
+
+		StackFrame frame = e.Thread.GetFrames () [0];
+		var o = frame.GetThis () as ObjectMirror;
+
+		bool failed = false;
+
+		bool finished = false;
+		object wait = new object ();
+
+		// Have to invoke in a separate thread as the invoke is suspended until we
+		// resume after the breakpoint
+		Thread t = new Thread (delegate () {
+				try {
+					o.InvokeMethod (e.Thread, m, null);
+				} catch {
+					failed = true;
+				}
+				lock (wait) {
+					finished = true;
+					Monitor.Pulse (wait);
+				}
+			});
+
+		t.Start ();
+
+		StackFrame invoke_frame = null;
+
+		try {
+			e = vm.GetNextEvent ();
+			Assert.IsInstanceOfType (typeof (BreakpointEvent), e);
+			// Check stack trace support and invokes
+			var frames = e.Thread.GetFrames ();
+			invoke_frame = frames [0];
+			Assert.AreEqual ("invoke2", frames [0].Method.Name);
+			Assert.IsTrue (frames [0].IsDebuggerInvoke);
+			Assert.AreEqual ("invoke1", frames [1].Method.Name);
+		} finally {
+			vm.Resume ();
+		}
+
+		// Check that the invoke frames are no longer valid
+		AssertThrows<InvalidStackFrameException> (delegate {
+				invoke_frame.GetThis ();
+			});
+
+		lock (wait) {
+			if (!finished)
+				Monitor.Wait (wait);
+		}
+
+		// Check InvokeOptions.DisableBreakpoints flag
+		o.InvokeMethod (e.Thread, m, null, InvokeOptions.DisableBreakpoints);
+	}
+
+	[Test]
+	public void InvokeSingleThreaded () {
+		vm.Dispose ();
+
+		Start (new string [] { "dtest-app.exe", "invoke-single-threaded" });
+
+		Event e = run_until ("invoke_single_threaded_2");
+
+		StackFrame f = e.Thread.GetFrames ()[0];
+
+		var obj = f.GetThis () as ObjectMirror;
+
+		// Check that the counter value incremented by the other thread does not increase
+		// during the invoke.
+		object counter1 = (obj.GetValue (obj.Type.GetField ("counter")) as PrimitiveValue).Value;
+
+		var m = obj.Type.GetMethod ("invoke_return_void");
+		obj.InvokeMethod (e.Thread, m, null, InvokeOptions.SingleThreaded);
+
+	    object counter2 = (obj.GetValue (obj.Type.GetField ("counter")) as PrimitiveValue).Value;
+
+		Assert.AreEqual ((int)counter1, (int)counter2);
+
+		// Test multiple invokes done in succession
+		m = obj.Type.GetMethod ("invoke_return_void");
+		obj.InvokeMethod (e.Thread, m, null, InvokeOptions.SingleThreaded);
+
+		// Test events during single-threaded invokes
+		vm.EnableEvents (EventType.TypeLoad);
+		m = obj.Type.GetMethod ("invoke_type_load");
+		obj.BeginInvokeMethod (e.Thread, m, null, InvokeOptions.SingleThreaded, delegate {
+				vm.Resume ();
+			}, null);
+
+		e = vm.GetNextEvent ();
+		Assert.AreEqual (EventType.TypeLoad, e.EventType);
+	}
+
+	[Test]
+	public void GetThreads () {
+		vm.GetThreads ();
+	}
+
+	[Test]
+	public void Threads () {
+		Event e = run_until ("threads");
+
+		Assert.AreEqual (ThreadState.Running, e.Thread.ThreadState);
+
+		Assert.IsTrue (e.Thread.ThreadId > 0);
+
+		vm.EnableEvents (EventType.ThreadStart, EventType.ThreadDeath);
+
+		vm.Resume ();
+
+		e = vm.GetNextEvent ();
+		Assert.IsInstanceOfType (typeof (ThreadStartEvent), e);
+		var state = e.Thread.ThreadState;
+		Assert.IsTrue (state == ThreadState.Running || state == ThreadState.Unstarted);
+
+		vm.Resume ();
+
+		e = vm.GetNextEvent ();
+		Assert.IsInstanceOfType (typeof (ThreadDeathEvent), e);
+		Assert.AreEqual (ThreadState.Stopped, e.Thread.ThreadState);
+	}
+
+	[Test]
+	public void Frame_SetValue () {
+		Event e = run_until ("locals2");
+
+		StackFrame frame = e.Thread.GetFrames () [0];
+
+		// primitive
+		var l = frame.Method.GetLocal ("i");
+		frame.SetValue (l, vm.CreateValue ((long)55));
+		AssertValue (55, frame.GetValue (l));
+
+		// reference
+		l = frame.Method.GetLocal ("s");
+		frame.SetValue (l, vm.RootDomain.CreateString ("DEF"));
+		AssertValue ("DEF", frame.GetValue (l));
+
+		// argument as local
+		l = frame.Method.GetLocal ("arg");
+		frame.SetValue (l, vm.CreateValue (6));
+		AssertValue (6, frame.GetValue (l));
+
+		// argument
+		var p = frame.Method.GetParameters ()[1];
+		frame.SetValue (p, vm.CreateValue (7));
+		AssertValue (7, frame.GetValue (p));
+
+		// argument checking
+
+		// variable null
+		AssertThrows<ArgumentNullException> (delegate () {
+				frame.SetValue ((LocalVariable)null, vm.CreateValue (55));
+			});
+
+		// value null
+		AssertThrows<ArgumentNullException> (delegate () {
+				l = frame.Method.GetLocal ("i");
+				frame.SetValue (l, null);
+			});
+
+		// value of invalid type
+		AssertThrows<ArgumentException> (delegate () {
+				l = frame.Method.GetLocal ("i");
+				frame.SetValue (l, vm.CreateValue (55));
+			});
+	}
+
+	[Test]
+	public void InvokeRegress () {
+		Event e = run_until ("invoke1");
+
+		StackFrame frame = e.Thread.GetFrames () [0];
+
+		TypeMirror t = frame.Method.DeclaringType;
+		ObjectMirror this_obj = (ObjectMirror)frame.GetThis ();
+
+		TypeMirror t2 = frame.Method.GetParameters ()[0].ParameterType;
+
+		MethodMirror m;
+		Value v;
+
+		// do an invoke
+		m = t.GetMethod ("invoke_return_void");
+		v = this_obj.InvokeMethod (e.Thread, m, null);
+		Assert.IsNull (v);
+
+		// Check that the stack frames remain valid during the invoke
+		Assert.AreEqual ("Tests", (frame.GetThis () as ObjectMirror).Type.Name);
+
+		// do another invoke
+		m = t.GetMethod ("invoke_return_void");
+		v = this_obj.InvokeMethod (e.Thread, m, null);
+		Assert.IsNull (v);
+
+		// Try a single step after the invoke
+		var req = vm.CreateStepRequest (e.Thread);
+		req.Depth = StepDepth.Into;
+		req.Size = StepSize.Line;
+		req.Enable ();
+
+		step_req = req;
+
+		// Step into invoke2
+		vm.Resume ();
+		e = vm.GetNextEvent ();
+		Assert.IsTrue (e is StepEvent);
+		Assert.AreEqual ("invoke2", (e as StepEvent).Method.Name);
+
+		req.Disable ();
+
+		frame = e.Thread.GetFrames () [0];
+	}
+
+	[Test]
+	public void Exceptions () {
+		Event e = run_until ("exceptions");
+		var req = vm.CreateExceptionRequest (null);
+		req.Enable ();
+
+		vm.Resume ();
+
+		e = vm.GetNextEvent ();
+		Assert.IsInstanceOfType (typeof (ExceptionEvent), e);
+		Assert.AreEqual ("OverflowException", (e as ExceptionEvent).Exception.Type.Name);
+
+		var frames = e.Thread.GetFrames ();
+		Assert.AreEqual ("exceptions", frames [0].Method.Name);
+		req.Disable ();
+
+		// exception type filter
+
+		req = vm.CreateExceptionRequest (vm.RootDomain.Corlib.GetType ("System.ArgumentException"));
+		req.Enable ();
+
+		// Skip the throwing of the second OverflowException	   
+		vm.Resume ();
+
+		e = vm.GetNextEvent ();
+		Assert.IsInstanceOfType (typeof (ExceptionEvent), e);
+		Assert.AreEqual ("ArgumentException", (e as ExceptionEvent).Exception.Type.Name);
+		req.Disable ();
+
+		// exception type filter for subclasses
+		req = vm.CreateExceptionRequest (vm.RootDomain.Corlib.GetType ("System.Exception"));
+		req.Enable ();
+
+		vm.Resume ();
+
+		e = vm.GetNextEvent ();
+		Assert.IsInstanceOfType (typeof (ExceptionEvent), e);
+		Assert.AreEqual ("OverflowException", (e as ExceptionEvent).Exception.Type.Name);
+		req.Disable ();
+
+		// Implicit exceptions
+		req = vm.CreateExceptionRequest (null);
+		req.Enable ();
+
+		vm.Resume ();
+
+		e = vm.GetNextEvent ();
+		Assert.IsInstanceOfType (typeof (ExceptionEvent), e);
+		Assert.AreEqual ("NullReferenceException", (e as ExceptionEvent).Exception.Type.Name);
+		req.Disable ();
+
+		// Argument checking
+		AssertThrows<ArgumentException> (delegate {
+				vm.CreateExceptionRequest (e.Thread.Type);
+			});
+	}
+
+	[Test]
+	public void EventSets () {
+		//
+		// Create two filter which both match the same exception
+		//
+		Event e = run_until ("exceptions");
+
+		var req = vm.CreateExceptionRequest (null);
+		req.Enable ();
+
+		var req2 = vm.CreateExceptionRequest (vm.RootDomain.Corlib.GetType ("System.OverflowException"));
+		req2.Enable ();
+
+		vm.Resume ();
+
+		var es = vm.GetNextEventSet ();
+		Assert.AreEqual (2, es.Events.Length);
+
+		e = es [0];
+		Assert.IsInstanceOfType (typeof (ExceptionEvent), e);
+		Assert.AreEqual ("OverflowException", (e as ExceptionEvent).Exception.Type.Name);
+
+		e = es [1];
+		Assert.IsInstanceOfType (typeof (ExceptionEvent), e);
+		Assert.AreEqual ("OverflowException", (e as ExceptionEvent).Exception.Type.Name);
+
+		req.Disable ();
+		req2.Disable ();
+	}
+
+	//
+	// Test single threaded invokes during processing of nullref exceptions.
+	// These won't work if the exception handling is done from the sigsegv signal
+	// handler, since the sigsegv signal is disabled until control returns from the
+	// signal handler.
+	//
+	[Test]
+	[Category ("only3")]
+	public void NullRefExceptionAndSingleThreadedInvoke () {
+		Event e = run_until ("exceptions");
+		var req = vm.CreateExceptionRequest (vm.RootDomain.Corlib.GetType ("System.NullReferenceException"));
+		req.Enable ();
+
+		vm.Resume ();
+
+		e = vm.GetNextEvent ();
+		Assert.IsInstanceOfType (typeof (ExceptionEvent), e);
+		Assert.AreEqual ("NullReferenceException", (e as ExceptionEvent).Exception.Type.Name);
+
+		var ex = (e as ExceptionEvent).Exception;
+		var tostring_method = vm.RootDomain.Corlib.GetType ("System.Object").GetMethod ("ToString");
+		ex.InvokeMethod (e.Thread, tostring_method, null, InvokeOptions.SingleThreaded);
+	}
+
+	[Test]
+	public void Domains () {
+		vm.Dispose ();
+
+		Start (new string [] { "dtest-app.exe", "domain-test" });
+
+		vm.EnableEvents (EventType.AppDomainCreate, EventType.AppDomainUnload, EventType.AssemblyUnload);
+
+		Event e = run_until ("domains");
+
+		vm.Resume ();
+		
+		e = vm.GetNextEvent ();
+		Assert.IsInstanceOfType (typeof (AppDomainCreateEvent), e);
+
+		var domain = (e as AppDomainCreateEvent).Domain;
+
+		// Run until the callback in the domain
+		MethodMirror m = entry_point.DeclaringType.GetMethod ("invoke_in_domain");
+		Assert.IsNotNull (m);
+		vm.SetBreakpoint (m, 0);
+
+		while (true) {
+			vm.Resume ();
+			e = vm.GetNextEvent ();
+			if (e is BreakpointEvent)
+				break;
+		}
+
+		Assert.AreEqual ("invoke_in_domain", (e as BreakpointEvent).Method.Name);
+
+		// d_method is from another domain
+		MethodMirror d_method = (e as BreakpointEvent).Method;
+		Assert.IsTrue (m != d_method);
+
+		var frames = e.Thread.GetFrames ();
+		Assert.AreEqual ("invoke_in_domain", frames [0].Method.Name);
+		Assert.AreEqual ("invoke", frames [1].Method.Name);
+		Assert.AreEqual ("domains", frames [2].Method.Name);
+
+		// Test breakpoints on already JITted methods in other domains
+		m = entry_point.DeclaringType.GetMethod ("invoke_in_domain_2");
+		Assert.IsNotNull (m);
+		vm.SetBreakpoint (m, 0);
+
+		while (true) {
+			vm.Resume ();
+			e = vm.GetNextEvent ();
+			if (e is BreakpointEvent)
+				break;
+		}
+
+		Assert.AreEqual ("invoke_in_domain_2", (e as BreakpointEvent).Method.Name);
+
+		// This is empty when receiving the AppDomainCreateEvent
+		Assert.AreEqual ("domain", domain.FriendlyName);
+
+		// Run until the unload
+		while (true) {
+			vm.Resume ();
+			e = vm.GetNextEvent ();
+			if (e is AssemblyUnloadEvent) {
+				continue;
+			} else {
+				break;
+			}
+		}
+		Assert.IsInstanceOfType (typeof (AppDomainUnloadEvent), e);
+		Assert.AreEqual (domain, (e as AppDomainUnloadEvent).Domain);
+
+		// Run past the unload
+		e = run_until ("domains_2");
+
+		// Test access to unloaded types
+		// FIXME: Add an exception type for this
+		AssertThrows<Exception> (delegate {
+				d_method.DeclaringType.GetValue (d_method.DeclaringType.GetField ("static_i"));
+			});
+	}
+
+	[Test]
+	public void DynamicMethods () {
+		Event e = run_until ("dyn_call");
+
+		var m = e.Thread.GetFrames ()[1].Method;
+		Assert.AreEqual ("dyn_method", m.Name);
+
+		// Test access to IL
+		var body = m.GetMethodBody ();
+
+		ILInstruction ins = body.Instructions [0];
+		Assert.AreEqual (OpCodes.Ldstr, ins.OpCode);
+		Assert.AreEqual ("FOO", ins.Operand);
+	}
+
+	[Test]
+	public void RefEmit () {
+		vm.Dispose ();
+
+		Start (new string [] { "dtest-app.exe", "ref-emit-test" });
+
+		Event e = run_until ("ref_emit_call");
+
+		var m = e.Thread.GetFrames ()[1].Method;
+		Assert.AreEqual ("ref_emit_method", m.Name);
+
+		// Test access to IL
+		var body = m.GetMethodBody ();
+
+		ILInstruction ins;
+
+		ins = body.Instructions [0];
+		Assert.AreEqual (OpCodes.Ldstr, ins.OpCode);
+		Assert.AreEqual ("FOO", ins.Operand);
+
+		ins = body.Instructions [1];
+		Assert.AreEqual (OpCodes.Call, ins.OpCode);
+		Assert.IsInstanceOfType (typeof (MethodMirror), ins.Operand);
+		Assert.AreEqual ("ref_emit_call", (ins.Operand as MethodMirror).Name);
+	}
+
+	[Test]
+	public void IsAttached () {
+		var f = entry_point.DeclaringType.GetField ("is_attached");
+
+		Event e = run_until ("Main");
+
+		AssertValue (true, entry_point.DeclaringType.GetValue (f));
+	}
+
+	[Test]
+	public void StackTraceInNative () {
+		// Check that stack traces can be produced for threads in native code
+		vm.Dispose ();
+
+		Start (new string [] { "dtest-app.exe", "frames-in-native" });
+
+		var e = run_until ("frames_in_native");
+
+		// FIXME: This is racy
+		vm.Resume ();
+
+		Thread.Sleep (100);
+
+		vm.Suspend ();
+
+		StackFrame[] frames = e.Thread.GetFrames ();
+
+		int frame_index = -1;
+		for (int i = 0; i < frames.Length; ++i) {
+			if (frames [i].Method.Name == "Sleep") {
+				frame_index = i;
+				break;
+			}
+		}
+
+		Assert.IsTrue (frame_index != -1);
+		Assert.AreEqual ("Sleep", frames [frame_index].Method.Name);
+		Assert.AreEqual ("frames_in_native", frames [frame_index + 1].Method.Name);
+		Assert.AreEqual ("Main", frames [frame_index + 2].Method.Name);
+
+		// Check that invokes are disabled for such threads
+		TypeMirror t = frames [frame_index + 1].Method.DeclaringType;
+
+		// return void
+		var m = t.GetMethod ("invoke_static_return_void");
+		AssertThrows<InvalidOperationException> (delegate {
+				t.InvokeMethod (e.Thread, m, null);
+			});
+	}
+
+	[Test]
+	public void VirtualMachine_CreateEnumMirror () {
+		var e = run_until ("o1");
+		var frame = e.Thread.GetFrames () [0];
+
+		object val = frame.GetThis ();
+		Assert.IsTrue (val is ObjectMirror);
+		Assert.AreEqual ("Tests", (val as ObjectMirror).Type.Name);
+		ObjectMirror o = (val as ObjectMirror);
+
+		FieldInfoMirror field = o.Type.GetField ("field_enum");
+		Value f = o.GetValue (field);
+		TypeMirror enumType = (f as EnumMirror).Type;
+
+		o.SetValue (field, vm.CreateEnumMirror (enumType, vm.CreateValue (1)));
+		f = o.GetValue (field);
+		Assert.AreEqual (1, (f as EnumMirror).Value);
+
+		// Argument checking
+		AssertThrows<ArgumentNullException> (delegate () {
+				vm.CreateEnumMirror (enumType, null);
+			});
+
+		AssertThrows<ArgumentNullException> (delegate () {
+				vm.CreateEnumMirror (null, vm.CreateValue (1));
+			});
+
+		// null value
+		AssertThrows<ArgumentException> (delegate () {
+				vm.CreateEnumMirror (enumType, vm.CreateValue (null));
+			});
+
+		// value of a wrong type
+		AssertThrows<ArgumentException> (delegate () {
+				vm.CreateEnumMirror (enumType, vm.CreateValue ((long)1));
+			});
+	}
+}
\ No newline at end of file
diff --git a/mcs/class/Mono.Posix/Mono.Unix/ChangeLog b/mcs/class/Mono.Posix/Mono.Unix/ChangeLog
index 3901ef4..23aa656 100644
--- a/mcs/class/Mono.Posix/Mono.Unix/ChangeLog
+++ b/mcs/class/Mono.Posix/Mono.Unix/ChangeLog
@@ -1,3 +1,13 @@
+2010-04-15  Jonathan Pryor  <jpryor at novell.com>
+
+	* UnixSignal.cs: Fix build break under .NET 1.1 profile.
+
+2010-04-15  Jonathan Pryor  <jpryor at novell.com>
+
+	* UnixSignal.cs: Change the native WaitAny() method to accept a
+	  Mono_Posix_RuntimeIsShuttingDown delegate, so that we can prevent an
+	  infinite loop while shutting the process down.  Fixes #592981.
+
 2009-03-23  Jonathan Pryor  <jpryor at novell.com>
 
 	* UnixDriveInfo.cs: UnixDriveInfo.AvailableFreeSpace needs to return 
diff --git a/mcs/class/Mono.Posix/Mono.Unix/UnixSignal.cs b/mcs/class/Mono.Posix/Mono.Unix/UnixSignal.cs
index fc21e5f..065358c 100644
--- a/mcs/class/Mono.Posix/Mono.Unix/UnixSignal.cs
+++ b/mcs/class/Mono.Posix/Mono.Unix/UnixSignal.cs
@@ -94,9 +94,14 @@ namespace Mono.Unix {
 				EntryPoint="Mono_Unix_UnixSignal_uninstall")]
 		private static extern int uninstall (IntPtr info);
 
+#if NET_2_0
+		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
+#endif
+		delegate int Mono_Posix_RuntimeIsShuttingDown ();
+
 		[DllImport (Stdlib.MPH, CallingConvention=CallingConvention.Cdecl,
 				EntryPoint="Mono_Unix_UnixSignal_WaitAny")]
-		private static extern int WaitAny (IntPtr[] infos, int count, int timeout);
+		private static extern int WaitAny (IntPtr[] infos, int count, int timeout, Mono_Posix_RuntimeIsShuttingDown shutting_down);
 
 		[DllImport (Stdlib.MPH, CallingConvention=CallingConvention.Cdecl,
                                 EntryPoint="Mono_Posix_SIGRTMIN")]
@@ -199,7 +204,7 @@ namespace Mono.Unix {
 				if (infos [i] == IntPtr.Zero)
 					throw new InvalidOperationException ("Disposed UnixSignal");
 			}
-			return WaitAny (infos, infos.Length, millisecondsTimeout);
+			return WaitAny (infos, infos.Length, millisecondsTimeout, () => Environment.HasShutdownStarted ? 1 : 0);
 		}
 	}
 }
diff --git a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/ChangeLog b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/ChangeLog
index b3a60e2..eda3970 100644
--- a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/ChangeLog
+++ b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/ChangeLog
@@ -1,3 +1,12 @@
+2010-04-07 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* TlsServerCertificate.cs: display the error code.
+
+2010-03-11 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* TlsServerCertificate.cs: chain is built and validated in
+	System.dll now.
+
 2010-03-01 Gonzalo Paniagua Javier <gonzalo at novell.com>
 
 	* TlsServerCertificate.cs:
diff --git a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerCertificate.cs b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerCertificate.cs
index a747ba8..174e0eb 100644
--- a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerCertificate.cs
+++ b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerCertificate.cs
@@ -195,9 +195,27 @@ namespace Mono.Security.Protocol.Tls.Handshake.Client
 
 #if NET_2_0
 			if (context.SslStream.HaveRemoteValidation2Callback) {
-				if (context.SslStream.RaiseServerCertificateValidation2 (certificates))
+				ValidationResult res = context.SslStream.RaiseServerCertificateValidation2 (certificates);
+				if (res.Trusted)
 					return;
-				// Give a chance to the 1.x ICertificatePolicy callback
+
+				long error = res.ErrorCode;
+				switch (error) {
+				case 0x800B0101:
+					description = AlertDescription.CertificateExpired;
+					break;
+				case 0x800B010A:
+					description = AlertDescription.UnknownCA;
+					break;
+				case 0x800B0109:
+					description = AlertDescription.UnknownCA;
+					break;
+				default:
+					description = AlertDescription.CertificateUnknown;
+					break;
+				}
+				string err = String.Format ("0x{0:x}", error);
+				throw new TlsException (description, "Invalid certificate received from server. Error code: " + err);
 			}
 #endif
 			// the leaf is the web server certificate
@@ -251,22 +269,6 @@ namespace Mono.Security.Protocol.Tls.Handshake.Client
 				result = false;
 			}
 
-			// Attempt to use OSX certificates
-			//
-			// Ideally we should return the SecTrustResult
-#if !MONOTOUCH
-			if (System.IO.File.Exists (OSX509Certificates.SecurityLibrary)){
-#endif
-				OSX509Certificates.SecTrustResult trustResult =  OSX509Certificates.TrustEvaluateSsl (certificates);
-
-				// We could use the other values of trustResult to pass this extra information to the .NET 2 callback
-				// for values like SecTrustResult.Confirm
-				result = (trustResult == OSX509Certificates.SecTrustResult.Proceed ||
-					  trustResult == OSX509Certificates.SecTrustResult.Unspecified);
-#if !MONOTOUCH
-			}
-#endif
-			
 			if (!result) 
 			{
 				switch (verify.Status) 
diff --git a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/ChangeLog b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/ChangeLog
index 99ea92a..291b7b3 100644
--- a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/ChangeLog
+++ b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/ChangeLog
@@ -1,3 +1,18 @@
+2010-04-23 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* Context.cs:
+	* SslStreamBase.cs:
+	* RecordProtocol.cs: differentiate a received 'CloseNotify' alert from
+	one that we sent. Disposing the stream will try to send the
+	'CloseNotify' alert, if it hasn't already, and ignore any errors. This
+	is needed for FTPS to work.
+
+2010-03-11 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* SslStreamBase.cs:
+	* SslClientStream.cs:
+	* SslServerStream.cs: modify the 2.0 callback to return more info.
+
 2010-03-01 Gonzalo Paniagua Javier <gonzalo at novell.com>
 
 	* HttpsClientStream.cs: use Address instead of RequestUri to get
diff --git a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/Context.cs b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/Context.cs
index 295eee5..792a997 100644
--- a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/Context.cs
+++ b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/Context.cs
@@ -76,7 +76,8 @@ namespace Mono.Security.Protocol.Tls
 
 		// Misc
 		private bool	abbreviatedHandshake;
-		private bool	connectionEnd;
+		private bool	receivedConnectionEnd;
+		private bool	sentConnectionEnd;
 		private bool	protocolNegotiated;
 		
 		// Sequence numbers
@@ -203,10 +204,16 @@ namespace Mono.Security.Protocol.Tls
 			set { this.handshakeState = value; }
 		}
 
-		public bool ConnectionEnd
+		public bool ReceivedConnectionEnd
 		{
-			get { return this.connectionEnd; }
-			set { this.connectionEnd = value; }
+			get { return this.receivedConnectionEnd; }
+			set { this.receivedConnectionEnd = value; }
+		}
+
+		public bool SentConnectionEnd
+		{
+			get { return this.sentConnectionEnd; }
+			set { this.sentConnectionEnd = value; }
 		}
 
 		public CipherSuiteCollection SupportedCiphers
diff --git a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/RecordProtocol.cs b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/RecordProtocol.cs
index 6ccced6..878233f 100644
--- a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/RecordProtocol.cs
+++ b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/RecordProtocol.cs
@@ -311,7 +311,7 @@ namespace Mono.Security.Protocol.Tls
 
 		public IAsyncResult BeginReceiveRecord(Stream record, AsyncCallback callback, object state)
 		{
-			if (this.context.ConnectionEnd)
+			if (this.context.ReceivedConnectionEnd)
 			{
 				throw new TlsException(
 					AlertDescription.InternalError,
@@ -580,7 +580,7 @@ namespace Mono.Security.Protocol.Tls
 				switch (alertDesc)
 				{
 					case AlertDescription.CloseNotify:
-						this.context.ConnectionEnd = true;
+						this.context.ReceivedConnectionEnd = true;
 						break;
 				}
 				break;
@@ -624,9 +624,8 @@ namespace Mono.Security.Protocol.Tls
 			// Write record
 			this.SendRecord (ContentType.Alert, new byte[2] { (byte) level, (byte) description });
 
-			if (close)
-			{
-				this.context.ConnectionEnd = true;
+			if (close) {
+				this.context.SentConnectionEnd = true;
 			}
 		}
 
@@ -695,7 +694,7 @@ namespace Mono.Security.Protocol.Tls
 
 		public IAsyncResult BeginSendRecord(ContentType contentType, byte[] recordData, AsyncCallback callback, object state)
 		{
-			if (this.context.ConnectionEnd)
+			if (this.context.SentConnectionEnd)
 			{
 				throw new TlsException(
 					AlertDescription.InternalError,
@@ -745,7 +744,7 @@ namespace Mono.Security.Protocol.Tls
 			int			offset,
 			int			count)
 		{
-			if (this.context.ConnectionEnd)
+			if (this.context.SentConnectionEnd)
 			{
 				throw new TlsException(
 					AlertDescription.InternalError,
diff --git a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/SslClientStream.cs b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/SslClientStream.cs
index a77346f..e820cb8 100644
--- a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/SslClientStream.cs
+++ b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/SslClientStream.cs
@@ -41,7 +41,32 @@ namespace Mono.Security.Protocol.Tls
 		X509Certificate certificate, 
 		int[]			certificateErrors);
 #if NET_2_0
-	public delegate bool CertificateValidationCallback2 (Mono.Security.X509.X509CertificateCollection collection);
+	public class ValidationResult {
+		bool trusted;
+		bool user_denied;
+		int error_code;
+
+		public ValidationResult (bool trusted, bool user_denied, int error_code)
+		{
+			this.trusted = trusted;
+			this.user_denied = user_denied;
+			this.error_code = error_code;
+		}
+
+		public bool Trusted {
+			get { return trusted; }
+		}
+
+		public bool UserDenied {
+			get { return user_denied; }
+		}
+
+		public int ErrorCode {
+			get { return error_code; }
+		}
+	}
+
+	public delegate ValidationResult CertificateValidationCallback2 (Mono.Security.X509.X509CertificateCollection collection);
 #endif
 
 	public delegate X509Certificate CertificateSelectionCallback(
@@ -387,12 +412,12 @@ namespace Mono.Security.Protocol.Tls
 			get { return ServerCertValidation2 != null; }
 		}
 
-		internal override bool OnRemoteCertificateValidation2 (Mono.Security.X509.X509CertificateCollection collection)
+		internal override ValidationResult OnRemoteCertificateValidation2 (Mono.Security.X509.X509CertificateCollection collection)
 		{
 			CertificateValidationCallback2 cb = ServerCertValidation2;
 			if (cb != null)
 				return cb (collection);
-			return false;
+			return null;
 		}
 #endif
 
@@ -414,7 +439,7 @@ namespace Mono.Security.Protocol.Tls
 		}
 
 #if NET_2_0
-		internal virtual bool RaiseServerCertificateValidation2 (Mono.Security.X509.X509CertificateCollection collection)
+		internal virtual ValidationResult RaiseServerCertificateValidation2 (Mono.Security.X509.X509CertificateCollection collection)
 		{
 			return base.RaiseRemoteCertificateValidation2 (collection);
 		}
diff --git a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/SslServerStream.cs b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/SslServerStream.cs
index a281c8b..b459d3d 100644
--- a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/SslServerStream.cs
+++ b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/SslServerStream.cs
@@ -312,12 +312,12 @@ namespace Mono.Security.Protocol.Tls
 			get { return ClientCertValidation2 != null; }
 		}
 
-		internal override bool OnRemoteCertificateValidation2 (Mono.Security.X509.X509CertificateCollection collection)
+		internal override ValidationResult OnRemoteCertificateValidation2 (Mono.Security.X509.X509CertificateCollection collection)
 		{
 			CertificateValidationCallback2 cb = ClientCertValidation2;
 			if (cb != null)
 				return cb (collection);
-			return false;
+			return null;
 		}
 #endif
 
diff --git a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/SslStreamBase.cs b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/SslStreamBase.cs
index 4de62f2..72b1497 100644
--- a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/SslStreamBase.cs
+++ b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/SslStreamBase.cs
@@ -186,7 +186,7 @@ namespace Mono.Security.Protocol.Tls
 
 		internal abstract bool OnRemoteCertificateValidation(X509Certificate certificate, int[] errors);
 #if NET_2_0
-		internal abstract bool OnRemoteCertificateValidation2 (Mono.Security.X509.X509CertificateCollection collection);
+		internal abstract ValidationResult OnRemoteCertificateValidation2 (Mono.Security.X509.X509CertificateCollection collection);
 		internal abstract bool HaveRemoteValidation2Callback { get; }
 #endif
 
@@ -210,7 +210,7 @@ namespace Mono.Security.Protocol.Tls
 		}
 
 #if NET_2_0
-		internal bool RaiseRemoteCertificateValidation2 (Mono.Security.X509.X509CertificateCollection collection)
+		internal ValidationResult RaiseRemoteCertificateValidation2 (Mono.Security.X509.X509CertificateCollection collection)
 		{
 			return OnRemoteCertificateValidation2 (collection);
 		}
@@ -616,7 +616,7 @@ namespace Mono.Security.Protocol.Tls
 				{
 					asyncResult.SetComplete(preReadSize);
 				}
-				else if (!this.context.ConnectionEnd)
+				else if (!this.context.ReceivedConnectionEnd)
 				{
 					// this will read data from the network until we have (at least) one
 					// record to send back to the caller
@@ -735,11 +735,15 @@ namespace Mono.Security.Protocol.Tls
 
 				if (!dataToReturn && (n > 0))
 				{
-					// there is no record to return to caller and (possibly) more data waiting
-					// so continue reading from network (and appending to stream)
-					recordStream.Position = recordStream.Length;
-					this.innerStream.BeginRead(recbuf, 0, recbuf.Length,
-						new AsyncCallback(InternalReadCallback), state);
+					if (context.ReceivedConnectionEnd) {
+						internalResult.SetComplete (0);
+					} else {
+						// there is no record to return to caller and (possibly) more data waiting
+						// so continue reading from network (and appending to stream)
+						recordStream.Position = recordStream.Length;
+						this.innerStream.BeginRead(recbuf, 0, recbuf.Length,
+							new AsyncCallback(InternalReadCallback), state);
+					}
 				}
 				else
 				{
@@ -1194,10 +1198,13 @@ namespace Mono.Security.Protocol.Tls
 					if (this.innerStream != null)
 					{
 						if (this.context.HandshakeState == HandshakeState.Finished &&
-							!this.context.ConnectionEnd)
+							!this.context.SentConnectionEnd)
 						{
-							// Write close notify							
-							this.protocol.SendAlert(AlertDescription.CloseNotify);
+							// Write close notify
+							try {
+								this.protocol.SendAlert(AlertDescription.CloseNotify);
+							} catch {
+							}
 						}
 
 						if (this.ownsStream)
diff --git a/mcs/class/Mono.Security/Mono.Security.X509/ChangeLog b/mcs/class/Mono.Security/Mono.Security.X509/ChangeLog
index b20c91c..4e20301 100644
--- a/mcs/class/Mono.Security/Mono.Security.X509/ChangeLog
+++ b/mcs/class/Mono.Security/Mono.Security.X509/ChangeLog
@@ -1,3 +1,7 @@
+2010-03-11 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* OSX509Certificates.cs: moved to System.dll.
+
 2010-02-27  Miguel de Icaza  <miguel at novell.com>
 
 	* OSX509Certificates.cs: Add support to validate X509 certificate
diff --git a/mcs/class/Mono.Security/Mono.Security.X509/OSX509Certificates.cs b/mcs/class/Mono.Security/Mono.Security.X509/OSX509Certificates.cs
deleted file mode 100644
index c032f9b..0000000
--- a/mcs/class/Mono.Security/Mono.Security.X509/OSX509Certificates.cs
+++ /dev/null
@@ -1,142 +0,0 @@
-// Copyright (C) 2010 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-using System.Runtime.InteropServices;
-using Mono.Security.X509;
-using Mono.Security.X509.Extensions;
-
-namespace Mono.Security.X509 {
-
-	internal class OSX509Certificates {
-		public const string SecurityLibrary = "/System/Library/Frameworks/Security.framework/Security";
-		public const string CoreFoundationLibrary = "/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation";
-	
-		[DllImport (SecurityLibrary)]
-		extern static IntPtr SecCertificateCreateWithData (IntPtr allocator, IntPtr nsdataRef);
-		
-		[DllImport (SecurityLibrary)]
-		extern static int SecTrustCreateWithCertificates (IntPtr certOrCertArray, IntPtr policies, out IntPtr sectrustref);
-		
-		[DllImport (SecurityLibrary)]
-		extern static IntPtr SecPolicyCreateSSL (int server, IntPtr cfStringHostname);
-		
-		[DllImport (SecurityLibrary)]
-		extern static int SecTrustEvaluate (IntPtr secTrustRef, out SecTrustResult secTrustResultTime);
-
-		[DllImport (CoreFoundationLibrary)]
-		unsafe extern static IntPtr CFDataCreate (IntPtr allocator, byte *bytes, IntPtr length);
-
-		[DllImport (CoreFoundationLibrary)]
-		unsafe extern static void CFRelease (IntPtr handle);
-
-		[DllImport (CoreFoundationLibrary)]
-		extern static IntPtr CFArrayCreate (IntPtr allocator, IntPtr values, IntPtr numValues, IntPtr callbacks);
-		
-		public enum SecTrustResult {
-			Invalid,
-			Proceed,
-			Confirm,
-			Deny,
-			Unspecified,
-			RecoverableTrustFailure,
-			FatalTrustFailure,
-			ResultOtherError,
-		}
-
-		static IntPtr sslsecpolicy = SecPolicyCreateSSL (0, IntPtr.Zero);
-
-		static IntPtr MakeCFData (byte [] data)
-		{
-			unsafe {
-				fixed (byte *ptr = &data [0])
-					return CFDataCreate (IntPtr.Zero, ptr, (IntPtr) data.Length);
-			}
-		}
-
-		static unsafe IntPtr FromIntPtrs (IntPtr [] values)
-		{
-			fixed (IntPtr* pv = values) {
-				return CFArrayCreate (
-					IntPtr.Zero, 
-					(IntPtr) pv,
-					(IntPtr) values.Length,
-					IntPtr.Zero);
-			}
-		}
-		
-		public static SecTrustResult TrustEvaluateSsl (X509CertificateCollection certificates)
-		{
-			try {
-				return _TrustEvaluateSsl (certificates);
-			} catch {
-				return SecTrustResult.Deny;
-			}
-		}
-		
-		static SecTrustResult _TrustEvaluateSsl (X509CertificateCollection certificates)
-		{
-			if (certificates == null)
-				throw new ArgumentNullException ("certificates");
-
-			int certCount = certificates.Count;
-			IntPtr [] cfDataPtrs = new IntPtr [certCount];
-			IntPtr [] secCerts = new IntPtr [certCount];
-			IntPtr certArray = IntPtr.Zero;
-			
-			try {
-				for (int i = 0; i < certCount; i++)
-					cfDataPtrs [i] = MakeCFData (certificates [i].RawData);
-				
-				for (int i = 0; i < certCount; i++){
-					secCerts [i] = SecCertificateCreateWithData (IntPtr.Zero, cfDataPtrs [i]);
-					if (secCerts [i] == IntPtr.Zero){
-						CFRelease (cfDataPtrs [i]);
-						return SecTrustResult.Deny;
-					}
-				}
-				certArray = FromIntPtrs (secCerts);
-				IntPtr sectrust;
-				int code = SecTrustCreateWithCertificates (certArray, sslsecpolicy, out sectrust);
-				if (code == 0){
-					SecTrustResult result;
-					code = SecTrustEvaluate (sectrust, out result);
-					if (code != 0)
-						return SecTrustResult.Deny;
-
-					CFRelease (sectrust);
-					CFRelease (sslsecpolicy);
-					
-					return result;
-				}
-				return SecTrustResult.Deny;
-			} finally {
-				for (int i = 0; i < certCount; i++)
-					if (secCerts [i] != IntPtr.Zero)
-						CFRelease (cfDataPtrs [i]);
-
-				if (certArray != IntPtr.Zero)
-					CFRelease (certArray);
-			}
-		}
-	}
-}
-		
\ No newline at end of file
diff --git a/mcs/class/Mono.Security/Mono.Security.dll.sources b/mcs/class/Mono.Security/Mono.Security.dll.sources
index 44c2cc6..f38e35e 100644
--- a/mcs/class/Mono.Security/Mono.Security.dll.sources
+++ b/mcs/class/Mono.Security/Mono.Security.dll.sources
@@ -36,7 +36,6 @@
 ./Mono.Security.Cryptography/SHA224.cs
 ./Mono.Security.Cryptography/SHA224Managed.cs
 ./Mono.Security.Cryptography/SymmetricTransform.cs
-./Mono.Security.X509/OSX509Certificates.cs
 ./Mono.Security.X509/PKCS12.cs
 ./Mono.Security.X509/X501Name.cs
 ./Mono.Security.X509/X509Builder.cs
diff --git a/mcs/class/Mono.Security/Mono.Security/ASN1Convert.cs b/mcs/class/Mono.Security/Mono.Security/ASN1Convert.cs
index 612917c..5a0ed05 100644
--- a/mcs/class/Mono.Security/Mono.Security/ASN1Convert.cs
+++ b/mcs/class/Mono.Security/Mono.Security/ASN1Convert.cs
@@ -221,7 +221,7 @@ namespace Mono.Security {
 					break;
 			}
 #if NET_2_0
-			return DateTime.ParseExact (t, mask, null, DateTimeStyles.AdjustToUniversal);
+			return DateTime.ParseExact (t, mask, CultureInfo.InvariantCulture, DateTimeStyles.AdjustToUniversal);
 #else
 			DateTime result = DateTime.ParseExact (t, mask, null);
 			if (utc)
diff --git a/mcs/class/Mono.Security/Mono.Security/ChangeLog b/mcs/class/Mono.Security/Mono.Security/ChangeLog
index 56a0e5a..2703cbc 100644
--- a/mcs/class/Mono.Security/Mono.Security/ChangeLog
+++ b/mcs/class/Mono.Security/Mono.Security/ChangeLog
@@ -1,3 +1,9 @@
+2010-03-24  Sebastien Pouliot  <sebastien at ximian.com>
+
+	* ASN1Convert.cs: Specify CultureInfo.InvariantCulture (instead of 
+	null) to avoid crash on Windows. Patch by Yoni Shalom.
+	[Backport r154135]
+
 2008-09-12  Sebastien Pouliot  <sebastien at ximian.com>
 
 	* ASN1.cs: Use File.Create instead of OpenWrite to make sure nothing
diff --git a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/ChangeLog b/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/ChangeLog
index 3bc4ea6..c0c3533 100644
--- a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/ChangeLog
+++ b/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/ChangeLog
@@ -1,3 +1,7 @@
+2010-05-12  Marek Habersack  <mhabersack at novell.com>
+
+	* RequiredAttribute.cs: implemented. Fixes bug #604100
+
 2009-09-15  Marek Habersack  <mhabersack at novell.com>
 
 	* DataTypeAttribute.cs: implemented GetDataTypeName
diff --git a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/RequiredAttribute.cs b/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/RequiredAttribute.cs
index 645986d..46318de 100644
--- a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/RequiredAttribute.cs
+++ b/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/RequiredAttribute.cs
@@ -4,7 +4,7 @@
 // Author:
 //	Atsushi Enomoto <atsushi at ximian.com>
 //
-// Copyright (C) 2008 Novell Inc. http://novell.com
+// Copyright (C) 2008-2010 Novell Inc. http://novell.com
 //
 
 //
@@ -35,10 +35,24 @@ namespace System.ComponentModel.DataAnnotations
 	[AttributeUsage (AttributeTargets.Property|AttributeTargets.Field, AllowMultiple = false)]
 	public class RequiredAttribute : ValidationAttribute
 	{
-		[MonoTODO]
+#if NET_4_0
+		public bool AllowEmptyStrings { get; set; }
+#endif
+
 		public override bool IsValid (object value)
 		{
-			throw new NotImplementedException ();
+			if (value == null)
+				return false;
+
+			string s = value as string;
+			if (s != null
+#if NET_4_0
+			    && !AllowEmptyStrings
+#endif
+			)
+				return s.Length > 0;
+
+			return true;
 		}
 	}
 }
diff --git a/mcs/class/System.Core/System.Linq.Expressions/ChangeLog b/mcs/class/System.Core/System.Linq.Expressions/ChangeLog
index 82c6243..e68a6e1 100644
--- a/mcs/class/System.Core/System.Linq.Expressions/ChangeLog
+++ b/mcs/class/System.Core/System.Linq.Expressions/ChangeLog
@@ -1,3 +1,9 @@
+2010-05-19  Jb Evain  <jbevain at novell.com>
+
+	backport of r157550.
+
+	* ConstantExpression.cs: fix emission of nullable constants.
+
 2010-01-08  Jb Evain  <jbevain at novell.com>
 
 	* Expression.cs (Call): properly deal with zero length array
diff --git a/mcs/class/System.Core/System.Linq.Expressions/ConstantExpression.cs b/mcs/class/System.Core/System.Linq.Expressions/ConstantExpression.cs
index 0bf985c..1a8c4d7 100644
--- a/mcs/class/System.Core/System.Linq.Expressions/ConstantExpression.cs
+++ b/mcs/class/System.Core/System.Linq.Expressions/ConstantExpression.cs
@@ -52,9 +52,33 @@ namespace System.Linq.Expressions {
 
 		internal override void Emit (EmitContext ec)
 		{
-			ILGenerator ig = ec.ig;
+			if (Type.IsNullable ()) {
+				EmitNullableConstant (ec, Type, value);
+				return;
+			}
+
+			EmitConstant (ec, Type, value);
+		}
+
+		void EmitNullableConstant (EmitContext ec, Type type, object value)
+		{
+			if (value == null) {
+				var ig = ec.ig;
+				var local = ig.DeclareLocal (type);
+				ig.Emit (OpCodes.Ldloca, local);
+				ig.Emit (OpCodes.Initobj, type);
+				ig.Emit (OpCodes.Ldloc, local);
+			} else {
+				EmitConstant (ec, type.GetFirstGenericArgument (), value);
+				ec.EmitNullableNew (type);
+			}
+		}
+
+		void EmitConstant (EmitContext ec, Type type, object value)
+		{
+			var ig = ec.ig;
 
-			switch (Type.GetTypeCode (Type)){
+			switch (Type.GetTypeCode (type)){
 			case TypeCode.Byte:
 				ig.Emit (OpCodes.Ldc_I4, (int) ((byte)value));
 				return;
@@ -163,17 +187,7 @@ namespace System.Linq.Expressions {
 		void EmitIfNotNull (EmitContext ec, Action<EmitContext> emit)
 		{
 			if (value == null) {
-				var ig = ec.ig;
-
-				if (Type.IsValueType) { // happens for nullable types
-					var local = ig.DeclareLocal (Type);
-					ig.Emit (OpCodes.Ldloca, local);
-					ig.Emit (OpCodes.Initobj, Type);
-					ig.Emit (OpCodes.Ldloc, local);
-				} else {
-					ec.ig.Emit (OpCodes.Ldnull);
-				}
-
+				ec.ig.Emit (OpCodes.Ldnull);
 				return;
 			}
 
diff --git a/mcs/class/System.Core/System.Linq/ChangeLog b/mcs/class/System.Core/System.Linq/ChangeLog
index 1555443..166938b 100644
--- a/mcs/class/System.Core/System.Linq/ChangeLog
+++ b/mcs/class/System.Core/System.Linq/ChangeLog
@@ -1,3 +1,53 @@
+2010-07-14  Jb Evain  <jbevain at novell.com>
+
+	backport of r160338.
+
+	* Enumerable.cs (Union): fix HashSet.Contains call.
+
+2010-07-13  Jb Evain  <jbevain at novell.com>
+
+	backport of r160298.
+
+	* Enumerable.cs (Except): fix HashSet.Contains call.
+	Fixes #621911.
+
+2010-06-22  Jb Evain  <jbevain at novell.com>
+
+	backport of r159337.
+
+	* Queryable.cs: properly set the constants types in the queryable
+	expression tree.
+
+2010-06-22  Jb Evain  <jbevain at novell.com>
+
+	backport of r159329.
+
+	* QueryableEnumerable.cs: override ToString.
+
+2010-05-25  Jb Evain  <jbevain at novell.com>
+
+	backport of r157831.
+
+	* Enumerable.cs: make Reverse lazier. Based on a patch by
+	Matthew Flaschen <matthew.flaschen at gatech.edu>. Fixes #608195.
+
+2010-05-19  Jb Evain  <jbevain at novell.com>
+
+	* Enumerable.cs: fix GroupBy to deal with a null key for the last
+	group entry. Also fix GroupBy to properly throw ArgumentNullException.
+
+2010-03-24  Andrés G. Aragoneses  <knocte at gmail.com>
+
+	* SortSequenceContext.cs: Fix build, broken in r154156 by a
+	typo in the last backport.
+
+2010-03-24  Jb Evain  <jbevain at novell.com>
+
+	* SortSequenceContext.cs: Fix OrderByDescending stability.
+	Based on a patch by Richard Kiene  <richard.kiene at logos.com>.
+
+	backport of r154154.
+
 2009-11-14  Jb Evain  <jbevain at novell.com>
 
 	* QueryableTransformer: adjust to latest ExpressionTransformer
diff --git a/mcs/class/System.Core/System.Linq/Enumerable.cs b/mcs/class/System.Core/System.Linq/Enumerable.cs
index 083113a..067aaea 100644
--- a/mcs/class/System.Core/System.Linq/Enumerable.cs
+++ b/mcs/class/System.Core/System.Linq/Enumerable.cs
@@ -566,7 +566,7 @@ namespace System.Linq
 		{
 			var items = new HashSet<TSource> (second, comparer);
 			foreach (var element in first) {
-				if (!items.Contains (element, comparer))
+				if (!items.Contains (element))
 					yield return element;
 			}
 		}
@@ -664,8 +664,8 @@ namespace System.Linq
 		static IEnumerable<IGrouping<TKey, TSource>> CreateGroupByIterator<TSource, TKey> (this IEnumerable<TSource> source,
 			Func<TSource, TKey> keySelector, IEqualityComparer<TKey> comparer)
 		{
-			Dictionary<TKey, List<TSource>> groups = new Dictionary<TKey, List<TSource>> ();
-			List<TSource> nullList = new List<TSource> ();
+			var groups = new Dictionary<TKey, List<TSource>> ();
+			var nullList = new List<TSource> ();
 			int counter = 0;
 			int nullCounter = -1;
 
@@ -689,14 +689,18 @@ namespace System.Linq
 			}
 
 			counter = 0;
-			foreach (KeyValuePair<TKey, List<TSource>> group in groups) {
+			foreach (var group in groups) {
 				if (counter == nullCounter) {
-					Grouping<TKey, TSource> nullGroup = new Grouping<TKey, TSource> (default (TKey), nullList);
-					yield return nullGroup;
+					yield return new Grouping<TKey, TSource> (default (TKey), nullList);
 					counter++;
 				}
-				Grouping<TKey, TSource> grouping = new Grouping<TKey, TSource> (group.Key, group.Value);
-				yield return grouping;
+
+				yield return new Grouping<TKey, TSource> (group.Key, group.Value);
+				counter++;
+			}
+
+			if (counter == nullCounter) {
+				yield return new Grouping<TKey, TSource> (default (TKey), nullList);
 				counter++;
 			}
 		}
@@ -712,8 +716,14 @@ namespace System.Linq
 		{
 			Check.SourceAndKeyElementSelectors (source, keySelector, elementSelector);
 
-			Dictionary<TKey, List<TElement>> groups = new Dictionary<TKey, List<TElement>> ();
-			List<TElement> nullList = new List<TElement> ();
+			return CreateGroupByIterator (source, keySelector, elementSelector, comparer);
+		}
+
+		static IEnumerable<IGrouping<TKey, TElement>> CreateGroupByIterator<TSource, TKey, TElement> (this IEnumerable<TSource> source,
+			Func<TSource, TKey> keySelector, Func<TSource, TElement> elementSelector, IEqualityComparer<TKey> comparer)
+		{
+			var groups = new Dictionary<TKey, List<TElement>> ();
+			var nullList = new List<TElement> ();
 			int counter = 0;
 			int nullCounter = -1;
 
@@ -738,14 +748,18 @@ namespace System.Linq
 			}
 
 			counter = 0;
-			foreach (KeyValuePair<TKey, List<TElement>> group in groups) {
+			foreach (var group in groups) {
 				if (counter == nullCounter) {
-					Grouping<TKey, TElement> nullGroup = new Grouping<TKey, TElement> (default (TKey), nullList);
-					yield return nullGroup;
+					yield return new Grouping<TKey, TElement> (default (TKey), nullList);
 					counter++;
 				}
-				Grouping<TKey, TElement> grouping = new Grouping<TKey, TElement> (group.Key, group.Value);
-				yield return grouping;
+
+				yield return new Grouping<TKey, TElement> (group.Key, group.Value);
+				counter++;
+			}
+
+			if (counter == nullCounter) {
+				yield return new Grouping<TKey, TElement> (default (TKey), nullList);
 				counter++;
 			}
 		}
@@ -762,6 +776,16 @@ namespace System.Linq
 			Func<TKey, IEnumerable<TElement>, TResult> resultSelector,
 			IEqualityComparer<TKey> comparer)
 		{
+			Check.GroupBySelectors (source, keySelector, elementSelector, resultSelector);
+
+			return CreateGroupByIterator (source, keySelector, elementSelector, resultSelector, comparer);
+		}
+
+		static IEnumerable<TResult> CreateGroupByIterator<TSource, TKey, TElement, TResult> (this IEnumerable<TSource> source,
+			Func<TSource, TKey> keySelector, Func<TSource, TElement> elementSelector,
+			Func<TKey, IEnumerable<TElement>, TResult> resultSelector,
+			IEqualityComparer<TKey> comparer)
+		{
 			IEnumerable<IGrouping<TKey, TElement>> groups = GroupBy<TSource, TKey, TElement> (
 				source, keySelector, elementSelector, comparer);
 
@@ -781,6 +805,16 @@ namespace System.Linq
 			Func<TKey, IEnumerable<TSource>, TResult> resultSelector,
 			IEqualityComparer<TKey> comparer)
 		{
+			Check.SourceAndKeyResultSelectors (source, keySelector, resultSelector);
+
+			return CreateGroupByIterator (source, keySelector, resultSelector, comparer);
+		}
+
+		static IEnumerable<TResult> CreateGroupByIterator<TSource, TKey, TResult> (this IEnumerable<TSource> source,
+			Func<TSource, TKey> keySelector,
+			Func<TKey, IEnumerable<TSource>, TResult> resultSelector,
+			IEqualityComparer<TKey> comparer)
+		{
 			IEnumerable<IGrouping<TKey,TSource>> groups = GroupBy<TSource, TKey> (source, keySelector, comparer);
 
 			foreach (IGrouping<TKey, TSource> group in groups)
@@ -1541,17 +1575,17 @@ namespace System.Linq
 		{
 			Check.Source (source);
 
+			return CreateReverseIterator (source);
+		}
+
+		static IEnumerable<TSource> CreateReverseIterator<TSource> (IEnumerable<TSource> source)
+		{
 			var list = source as IList<TSource>;
 			if (list == null)
 				list = new List<TSource> (source);
 
-			return CreateReverseIterator (list);
-		}
-
-		static IEnumerable<TSource> CreateReverseIterator<TSource> (IList<TSource> source)
-		{
-			for (int i = source.Count; i > 0; --i)
-				yield return source [i - 1];
+			for (int i = list.Count - 1; i >= 0; i--)
+				yield return list [i];
 		}
 
 		#endregion
@@ -2247,7 +2281,7 @@ namespace System.Linq
 			}
 
 			foreach (var element in second) {
-				if (! items.Contains (element, comparer)) {
+				if (! items.Contains (element)) {
 					items.Add (element);
 					yield return element;
 				}
diff --git a/mcs/class/System.Core/System.Linq/Queryable.cs b/mcs/class/System.Core/System.Linq/Queryable.cs
index 4aaccdf..9d59829 100644
--- a/mcs/class/System.Core/System.Linq/Queryable.cs
+++ b/mcs/class/System.Core/System.Linq/Queryable.cs
@@ -77,7 +77,7 @@ namespace System.Linq {
 				StaticCall (
 					MakeGeneric (MethodBase.GetCurrentMethod (), typeof (TSource), typeof (TAccumulate)),
 					source.Expression,
-					Expression.Constant (seed),
+					Expression.Constant (seed, typeof (TAccumulate)),
 					Expression.Quote (func)));
 		}
 
@@ -88,7 +88,7 @@ namespace System.Linq {
 				StaticCall (
 					MakeGeneric (MethodBase.GetCurrentMethod (), typeof (TSource), typeof (TAccumulate), typeof (TResult)),
 					source.Expression,
-					Expression.Constant (seed),
+					Expression.Constant (seed, typeof (TAccumulate)),
 					Expression.Quote (func),
 					Expression.Quote (selector)));
 		}
@@ -406,7 +406,7 @@ namespace System.Linq {
 				StaticCall (
 					MakeGeneric (MethodBase.GetCurrentMethod (), typeof (TSource)),
 					source1.Expression,
-					Expression.Constant (source2)));
+					Expression.Constant (source2, typeof (IEnumerable<TSource>))));
 		}
 
 		#endregion
@@ -421,7 +421,7 @@ namespace System.Linq {
 				StaticCall (
 					MakeGeneric (MethodBase.GetCurrentMethod (), typeof (TSource)),
 					source.Expression,
-					Expression.Constant (item)));
+					Expression.Constant (item, typeof (TSource))));
 		}
 
 		public static bool Contains<TSource> (this IQueryable<TSource> source, TSource item, IEqualityComparer<TSource> comparer)
@@ -432,8 +432,8 @@ namespace System.Linq {
 				StaticCall (
 					MakeGeneric (MethodBase.GetCurrentMethod (), typeof (TSource)),
 					source.Expression,
-					Expression.Constant (item),
-					Expression.Constant (comparer)));
+					Expression.Constant (item, typeof (TSource)),
+					Expression.Constant (comparer, typeof (IEqualityComparer<TSource>))));
 		}
 
 		#endregion
@@ -480,7 +480,7 @@ namespace System.Linq {
 				StaticCall (
 					MakeGeneric (MethodBase.GetCurrentMethod (), typeof (TSource)),
 					source.Expression,
-					Expression.Constant (defaultValue)));
+					Expression.Constant (defaultValue, typeof (TSource))));
 		}
 
 		#endregion
@@ -505,7 +505,7 @@ namespace System.Linq {
 				StaticCall (
 					MakeGeneric (MethodBase.GetCurrentMethod (), typeof (TSource)),
 					source.Expression,
-					Expression.Constant (comparer)));
+					Expression.Constant (comparer, typeof (IEqualityComparer<TSource>))));
 		}
 
 		#endregion
@@ -550,7 +550,7 @@ namespace System.Linq {
 				StaticCall (
 					MakeGeneric (MethodBase.GetCurrentMethod (), typeof (TSource)),
 					source1.Expression,
-					Expression.Constant (source2)));
+					Expression.Constant (source2, typeof (IEnumerable<TSource>))));
 		}
 
 		public static IQueryable<TSource> Except<TSource> (this IQueryable<TSource> source1, IEnumerable<TSource> source2, IEqualityComparer<TSource> comparer)
@@ -561,8 +561,8 @@ namespace System.Linq {
 				StaticCall (
 					MakeGeneric (MethodBase.GetCurrentMethod (), typeof (TSource)),
 					source1.Expression,
-					Expression.Constant (source2),
-					Expression.Constant (comparer)));
+					Expression.Constant (source2, typeof (IEnumerable<TSource>)),
+					Expression.Constant (comparer, typeof (IEqualityComparer<TSource>))));
 		}
 
 		#endregion
@@ -638,7 +638,7 @@ namespace System.Linq {
 					MakeGeneric (MethodBase.GetCurrentMethod (), typeof (TSource), typeof (TKey)),
 					source.Expression,
 					Expression.Quote (keySelector),
-					Expression.Constant (comparer)));
+					Expression.Constant (comparer, typeof (IEqualityComparer<TKey>))));
 		}
 		public static IQueryable<IGrouping<TKey, TElement>> GroupBy<TSource, TKey, TElement> (this IQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector, Expression<Func<TSource, TElement>> elementSelector)
 		{
@@ -672,7 +672,7 @@ namespace System.Linq {
 					source.Expression,
 					Expression.Quote (keySelector),
 					Expression.Quote (elementSelector),
-					Expression.Constant (comparer)));
+					Expression.Constant (comparer, typeof (IEqualityComparer<TKey>))));
 		}
 		public static IQueryable<TResult> GroupBy<TSource, TKey, TElement, TResult> (this IQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector, Expression<Func<TSource, TElement>> elementSelector, Expression<Func<TKey, IEnumerable<TElement>, TResult>> resultSelector)
 		{
@@ -697,7 +697,7 @@ namespace System.Linq {
 					source.Expression,
 					Expression.Quote (keySelector),
 					Expression.Quote (resultSelector),
-					Expression.Constant (comparer)));
+					Expression.Constant (comparer, typeof (IEqualityComparer<TKey>))));
 		}
 		public static IQueryable<TResult> GroupBy<TSource, TKey, TElement, TResult> (this IQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector, Expression<Func<TSource, TElement>> elementSelector, Expression<Func<TKey, IEnumerable<TElement>, TResult>> resultSelector, IEqualityComparer<TKey> comparer)
 		{
@@ -710,7 +710,7 @@ namespace System.Linq {
 					Expression.Quote (keySelector),
 					Expression.Quote (elementSelector),
 					Expression.Quote (resultSelector),
-					Expression.Constant (comparer)));
+					Expression.Constant (comparer, typeof (IEqualityComparer<TKey>))));
 		}
 		#endregion
 
@@ -733,7 +733,7 @@ namespace System.Linq {
 				StaticCall (
 					MakeGeneric (MethodBase.GetCurrentMethod (), typeof (TOuter), typeof (TInner), typeof (TKey), typeof (TResult)),
 					outer.Expression,
-					Expression.Constant (inner),
+					Expression.Constant (inner, typeof (IEnumerable<TInner>)),
 					Expression.Quote (outerKeySelector),
 					Expression.Quote (innerKeySelector),
 					Expression.Quote (resultSelector)));
@@ -756,7 +756,7 @@ namespace System.Linq {
 				StaticCall (
 					MakeGeneric (MethodBase.GetCurrentMethod (), typeof (TOuter), typeof (TInner), typeof (TKey), typeof (TResult)),
 					outer.Expression,
-					Expression.Constant (inner),
+					Expression.Constant (inner, typeof (IEnumerable<TInner>)),
 					Expression.Quote (outerKeySelector),
 					Expression.Quote (innerKeySelector),
 					Expression.Quote (resultSelector),
@@ -775,7 +775,7 @@ namespace System.Linq {
 				StaticCall (
 					MakeGeneric (MethodBase.GetCurrentMethod (), typeof (TSource)),
 					source1.Expression,
-					Expression.Constant (source2)));
+					Expression.Constant (source2, typeof (IEnumerable<TSource>))));
 		}
 
 		public static IQueryable<TSource> Intersect<TSource> (this IQueryable<TSource> source1, IEnumerable<TSource> source2, IEqualityComparer<TSource> comparer)
@@ -786,8 +786,8 @@ namespace System.Linq {
 				StaticCall (
 					MakeGeneric (MethodBase.GetCurrentMethod (), typeof (TSource)),
 					source1.Expression,
-					Expression.Constant (source2),
-					Expression.Constant (comparer)));
+					Expression.Constant (source2, typeof (IEnumerable<TSource>)),
+					Expression.Constant (comparer, typeof (IEqualityComparer<TSource>))));
 		}
 
 		#endregion
@@ -802,7 +802,7 @@ namespace System.Linq {
 				StaticCall (
 					MakeGeneric (MethodBase.GetCurrentMethod (), typeof (TOuter), typeof (TInner), typeof (TKey), typeof (TResult)),
 					outer.Expression,
-					Expression.Constant (inner),
+					Expression.Constant (inner, typeof (IEnumerable<TInner>)),
 					Expression.Quote (outerKeySelector),
 					Expression.Quote (innerKeySelector),
 					Expression.Quote (resultSelector)));
@@ -816,11 +816,11 @@ namespace System.Linq {
 				StaticCall (
 					MakeGeneric (MethodBase.GetCurrentMethod (), typeof (TOuter), typeof (TInner), typeof (TKey), typeof (TResult)),
 					outer.Expression,
-					Expression.Constant (inner),
+					Expression.Constant (inner, typeof (IEnumerable<TInner>)),
 					Expression.Quote (outerKeySelector),
 					Expression.Quote (innerKeySelector),
 					Expression.Quote (resultSelector),
-					Expression.Constant (comparer)));
+					Expression.Constant (comparer, typeof (IEqualityComparer<TKey>))));
 		}
 
 
@@ -986,7 +986,7 @@ namespace System.Linq {
 					MakeGeneric (MethodBase.GetCurrentMethod (), typeof (TSource), typeof (TKey)),
 					source.Expression,
 					Expression.Quote (keySelector),
-					Expression.Constant (comparer)));
+					Expression.Constant (comparer, typeof (IComparer<TKey>))));
 		}
 
 		#endregion
@@ -1013,7 +1013,7 @@ namespace System.Linq {
 					MakeGeneric (MethodBase.GetCurrentMethod (), typeof (TSource), typeof (TKey)),
 					source.Expression,
 					Expression.Quote (keySelector),
-					Expression.Constant (comparer)));
+					Expression.Constant (comparer, typeof (IComparer<TKey>))));
 		}
 
 		#endregion
@@ -1118,7 +1118,7 @@ namespace System.Linq {
 				StaticCall (
 					MakeGeneric (MethodBase.GetCurrentMethod (), typeof (TSource)),
 					source1.Expression,
-					Expression.Constant (source2)));
+					Expression.Constant (source2, typeof (IEnumerable<TSource>))));
 		}
 
 		public static bool SequenceEqual<TSource> (this IQueryable<TSource> source1, IEnumerable<TSource> source2, IEqualityComparer<TSource> comparer)
@@ -1129,8 +1129,8 @@ namespace System.Linq {
 				StaticCall (
 					MakeGeneric (MethodBase.GetCurrentMethod (), typeof (TSource)),
 					source1.Expression,
-					Expression.Constant (source2),
-					Expression.Constant (comparer)));
+					Expression.Constant (source2, typeof (IEnumerable<TSource>)),
+					Expression.Constant (comparer, typeof (IEqualityComparer<TSource>))));
 		}
 
 		#endregion
@@ -1517,7 +1517,7 @@ namespace System.Linq {
 					MakeGeneric (MethodBase.GetCurrentMethod (), typeof (TSource), typeof (TKey)),
 					source.Expression,
 					Expression.Quote (keySelector),
-					Expression.Constant (comparer)));
+					Expression.Constant (comparer, typeof (IComparer<TKey>))));
 		}
 
 		#endregion
@@ -1544,7 +1544,7 @@ namespace System.Linq {
 					MakeGeneric (MethodBase.GetCurrentMethod (), typeof (TSource), typeof (TKey)),
 					source.Expression,
 					Expression.Quote (keySelector),
-					Expression.Constant (comparer)));
+					Expression.Constant (comparer, typeof (IComparer<TKey>))));
 		}
 
 		#endregion
@@ -1559,7 +1559,7 @@ namespace System.Linq {
 				StaticCall (
 					MakeGeneric (MethodBase.GetCurrentMethod (), typeof (TSource)),
 					source1.Expression,
-					Expression.Constant (source2)));
+					Expression.Constant (source2, typeof (IEnumerable<TSource>))));
 		}
 
 		public static IQueryable<TSource> Union<TSource>(this IQueryable<TSource> source1, IEnumerable<TSource> source2, IEqualityComparer<TSource> comparer)
@@ -1570,8 +1570,8 @@ namespace System.Linq {
 				StaticCall (
 					MakeGeneric (MethodBase.GetCurrentMethod (), typeof (TSource)),
 					source1.Expression,
-					Expression.Constant (source2),
-					Expression.Constant (comparer)));
+					Expression.Constant (source2, typeof (IEnumerable<TSource>)),
+					Expression.Constant (comparer, typeof (IEqualityComparer<TSource>))));
 		}
 
 
diff --git a/mcs/class/System.Core/System.Linq/QueryableEnumerable.cs b/mcs/class/System.Core/System.Linq/QueryableEnumerable.cs
index f8ad6d1..0a3da70 100644
--- a/mcs/class/System.Core/System.Linq/QueryableEnumerable.cs
+++ b/mcs/class/System.Core/System.Linq/QueryableEnumerable.cs
@@ -117,5 +117,20 @@ namespace System.Linq {
 			var lambda = Expression.Lambda<Func<TResult>> (TransformQueryable (expression));
 			return lambda.Compile ().Invoke ();
 		}
+
+		public override string ToString ()
+		{
+			if (enumerable != null)
+				return enumerable.ToString ();
+
+			if (expression == null)
+				return base.ToString ();
+
+			var constant = expression as ConstantExpression;
+			if (constant != null && constant.Value == this)
+				return base.ToString ();
+
+			return expression.ToString ();
+		}
 	}
 }
diff --git a/mcs/class/System.Core/System.Linq/SortSequenceContext.cs b/mcs/class/System.Core/System.Linq/SortSequenceContext.cs
index 2ec4211..a25427e 100644
--- a/mcs/class/System.Core/System.Linq/SortSequenceContext.cs
+++ b/mcs/class/System.Core/System.Linq/SortSequenceContext.cs
@@ -62,8 +62,10 @@ namespace System.Linq {
 			if (comparison == 0) {
 				if (child_context != null)
 					return child_context.Compare (first_index, second_index);
-				else
-					comparison = first_index - second_index;
+
+				comparison = direction == SortDirection.Descending
+					? second_index - first_index
+					: first_index - second_index;
 			}
 
 			return direction == SortDirection.Descending ? -comparison : comparison;
diff --git a/mcs/class/System.Core/System/TimeZoneInfo.cs b/mcs/class/System.Core/System/TimeZoneInfo.cs
index d5e77e8..3e946b6 100644
--- a/mcs/class/System.Core/System/TimeZoneInfo.cs
+++ b/mcs/class/System.Core/System/TimeZoneInfo.cs
@@ -43,6 +43,8 @@ using System.IO;
 using Mono;
 #endif
 
+using Microsoft.Win32;
+
 namespace System
 {
 #if NET_4_0 || BOOTSRAP_NET_4_0
@@ -131,6 +133,23 @@ namespace System
 #endif
 		private AdjustmentRule [] adjustmentRules;
 
+		static RegistryKey timeZoneKey = null;
+		static bool timeZoneKeySet = false;
+		static RegistryKey TimeZoneKey {
+			get {
+				if (!timeZoneKeySet) {
+					int p = (int) Environment.OSVersion.Platform;
+					/* Only use the registry on non-Unix platforms. */
+					if ((p != 4) && (p != 6) && (p != 128))
+						timeZoneKey = Registry.LocalMachine.OpenSubKey (
+							"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Time Zones",
+							false);
+					timeZoneKeySet = true;
+				}
+				return timeZoneKey;
+			}
+		}
+
 		public static void ClearCachedData ()
 		{
 			local = null;
@@ -288,6 +307,13 @@ namespace System
 			//FIXME: this method should check for cached values in systemTimeZones
 			if (id == null)
 				throw new ArgumentNullException ("id");
+			if (TimeZoneKey != null)
+			{
+				RegistryKey key = TimeZoneKey.OpenSubKey (id, false);
+				if (key == null)
+					throw new TimeZoneNotFoundException ();
+				return FromRegistryKey(id, key);
+			}
 #if LIBC	
 			string filepath = Path.Combine (TimeZoneDirectory, id);
 			return FindSystemTimeZoneByFileName (id, filepath);
@@ -320,6 +346,123 @@ namespace System
 		}
 #endif
 
+		private static TimeZoneInfo FromRegistryKey (string id, RegistryKey key)
+		{
+			byte [] reg_tzi = (byte []) key.GetValue ("TZI");
+
+			if (reg_tzi == null)
+				throw new InvalidTimeZoneException ();
+
+			int bias = BitConverter.ToInt32 (reg_tzi, 0);
+			TimeSpan baseUtcOffset = new TimeSpan (0, -bias, 0);
+
+			string display_name = (string) key.GetValue ("Display");
+			string standard_name = (string) key.GetValue ("Std");
+			string daylight_name = (string) key.GetValue ("Dlt");
+
+			List<AdjustmentRule> adjustmentRules = new List<AdjustmentRule> ();
+
+			RegistryKey dst_key = key.OpenSubKey ("Dynamic DST", false);
+			if (dst_key != null) {
+				int first_year = (int) dst_key.GetValue ("FirstEntry");
+				int last_year = (int) dst_key.GetValue ("LastEntry");
+				int year;
+
+				for (year=first_year; year<=last_year; year++) {
+					byte [] dst_tzi = (byte []) dst_key.GetValue (year.ToString ());
+					if (dst_tzi != null) {
+						int start_year = year == first_year ? 1 : year;
+						int end_year = year == last_year ? 9999 : year;
+						ParseRegTzi(adjustmentRules, start_year, end_year, dst_tzi);
+					}
+				}
+			}
+			else
+				ParseRegTzi(adjustmentRules, 1, 9999, reg_tzi);
+
+			return CreateCustomTimeZone (id, baseUtcOffset, display_name, standard_name, daylight_name,
+							(AdjustmentRule []) ValidateRules (adjustmentRules).ToArray ());
+		}
+
+		static List<AdjustmentRule> ValidateRules (List<AdjustmentRule> adjustmentRules)
+		{
+			AdjustmentRule prev = null;
+			foreach (AdjustmentRule current in adjustmentRules.ToArray ()) {
+				if (prev != null && prev.DateEnd > current.DateStart) {
+					adjustmentRules.Remove (current);
+				}
+				prev = current;
+			}
+			return adjustmentRules;
+		}
+
+		private static void ParseRegTzi (List<AdjustmentRule> adjustmentRules, int start_year, int end_year, byte [] buffer)
+		{
+			//int standard_bias = BitConverter.ToInt32 (buffer, 4); /* not sure how to handle this */
+			int daylight_bias = BitConverter.ToInt32 (buffer, 8);
+
+			int standard_year = BitConverter.ToInt16 (buffer, 12);
+			int standard_month = BitConverter.ToInt16 (buffer, 14);
+			int standard_dayofweek = BitConverter.ToInt16 (buffer, 16);
+			int standard_day = BitConverter.ToInt16 (buffer, 18);
+			int standard_hour = BitConverter.ToInt16 (buffer, 20);
+			int standard_minute = BitConverter.ToInt16 (buffer, 22);
+			int standard_second = BitConverter.ToInt16 (buffer, 24);
+			int standard_millisecond = BitConverter.ToInt16 (buffer, 26);
+
+			int daylight_year = BitConverter.ToInt16 (buffer, 28);
+			int daylight_month = BitConverter.ToInt16 (buffer, 30);
+			int daylight_dayofweek = BitConverter.ToInt16 (buffer, 32);
+			int daylight_day = BitConverter.ToInt16 (buffer, 34);
+			int daylight_hour = BitConverter.ToInt16 (buffer, 36);
+			int daylight_minute = BitConverter.ToInt16 (buffer, 38);
+			int daylight_second = BitConverter.ToInt16 (buffer, 40);
+			int daylight_millisecond = BitConverter.ToInt16 (buffer, 42);
+
+			if (standard_month == 0 || daylight_month == 0)
+				return;
+
+			DateTime start_date;
+			DateTime start_timeofday = new DateTime (1, 1, 1, daylight_hour, daylight_minute, daylight_second, daylight_millisecond);
+			TransitionTime start_transition_time;
+
+			if (daylight_year == 0) {
+				start_date = new DateTime (start_year, 1, 1);
+				start_transition_time = TransitionTime.CreateFloatingDateRule (
+					start_timeofday, daylight_month, daylight_day,
+					(DayOfWeek) daylight_dayofweek);
+			}
+			else {
+				start_date = new DateTime (daylight_year, daylight_month, daylight_day,
+					daylight_hour, daylight_minute, daylight_second, daylight_millisecond);
+				start_transition_time = TransitionTime.CreateFixedDateRule (
+					start_timeofday, daylight_month, daylight_day);
+			}
+
+			DateTime end_date;
+			DateTime end_timeofday = new DateTime (1, 1, 1, standard_hour, standard_minute, standard_second, standard_millisecond);
+			TransitionTime end_transition_time;
+
+			if (standard_year == 0) {
+				end_date = new DateTime (end_year, 12, 31);
+				end_transition_time = TransitionTime.CreateFloatingDateRule (
+					end_timeofday, standard_month, standard_day,
+					(DayOfWeek) standard_dayofweek);
+			}
+			else {
+				end_date = new DateTime (standard_year, standard_month, standard_day,
+					standard_hour, standard_minute, standard_second, standard_millisecond);
+				end_transition_time = TransitionTime.CreateFixedDateRule (
+					end_timeofday, standard_month, standard_day);
+			}
+
+			TimeSpan daylight_delta = new TimeSpan(0, -daylight_bias, 0);
+
+			adjustmentRules.Add (AdjustmentRule.CreateAdjustmentRule (
+				start_date, end_date, daylight_delta,
+				start_transition_time, end_transition_time));
+		}
+
 		public static TimeZoneInfo FromSerializedString (string source)
 		{
 			throw new NotImplementedException ();
@@ -369,25 +512,35 @@ namespace System
 		{
 			if (systemTimeZones == null) {
 				systemTimeZones = new List<TimeZoneInfo> ();
+				if (TimeZoneKey != null) {
+					foreach (string id in TimeZoneKey.GetSubKeyNames ()) {
+						try {
+							systemTimeZones.Add (FindSystemTimeZoneById (id));
+						} catch {}
+					}
+				}
 #if LIBC
-				string[] continents = new string [] {"Africa", "America", "Antarctica", "Arctic", "Asia", "Atlantic", "Brazil", "Canada", "Chile", "Europe", "Indian", "Mexico", "Mideast", "Pacific", "US"};
-				foreach (string continent in continents) {
-					try {
-						foreach (string zonepath in Directory.GetFiles (Path.Combine (TimeZoneDirectory, continent))) {
-							try {
-								string id = String.Format ("{0}/{1}", continent, Path.GetFileName (zonepath));
-								systemTimeZones.Add (FindSystemTimeZoneById (id));
-							} catch (ArgumentNullException) {
-							} catch (TimeZoneNotFoundException) {
-							} catch (InvalidTimeZoneException) {
-							} catch (Exception) {
-								throw;
+				else {
+					string[] continents = new string [] {"Africa", "America", "Antarctica", "Arctic", "Asia", "Atlantic", "Brazil", "Canada", "Chile", "Europe", "Indian", "Mexico", "Mideast", "Pacific", "US"};
+					foreach (string continent in continents) {
+						try {
+							foreach (string zonepath in Directory.GetFiles (Path.Combine (TimeZoneDirectory, continent))) {
+								try {
+									string id = String.Format ("{0}/{1}", continent, Path.GetFileName (zonepath));
+									systemTimeZones.Add (FindSystemTimeZoneById (id));
+								} catch (ArgumentNullException) {
+								} catch (TimeZoneNotFoundException) {
+								} catch (InvalidTimeZoneException) {
+								} catch (Exception) {
+									throw;
+								}
 							}
-						}
-					} catch {}
+						} catch {}
+					}
 				}
 #else
-				throw new NotImplementedException ("This method is not implemented for this platform");
+				else
+					throw new NotImplementedException ("This method is not implemented for this platform");
 #endif
 			}
 			return new ReadOnlyCollection<TimeZoneInfo> (systemTimeZones);
@@ -589,12 +742,14 @@ namespace System
 			if (dateTime.Kind == DateTimeKind.Utc && this != TimeZoneInfo.Utc)
 				date = date + BaseUtcOffset;
 
-			foreach (AdjustmentRule rule in adjustmentRules) {
-				if (rule.DateStart > date.Date)
-					return null;
-				if (rule.DateEnd < date.Date)
-					continue;
-				return rule;
+			if (adjustmentRules != null) {
+				foreach (AdjustmentRule rule in adjustmentRules) {
+					if (rule.DateStart > date.Date)
+						return null;
+					if (rule.DateEnd < date.Date)
+						continue;
+					return rule;
+				}
 			}
 			return null;
 		}
@@ -753,22 +908,11 @@ namespace System
 				}
 				return CreateCustomTimeZone (id, baseUtcOffset, id, standardDisplayName);
 			} else {
-				return CreateCustomTimeZone (id, baseUtcOffset, id, standardDisplayName, daylightDisplayName, ValidateRules (adjustmentRules).ToArray ());
+				return CreateCustomTimeZone (id, baseUtcOffset, id, standardDisplayName, daylightDisplayName,
+								(AdjustmentRule []) ValidateRules (adjustmentRules).ToArray ());
 			}
 		}
 
-		static List<AdjustmentRule> ValidateRules (List<AdjustmentRule> adjustmentRules)
-		{
-			AdjustmentRule prev = null;
-			foreach (AdjustmentRule current in adjustmentRules.ToArray ()) {
-				if (prev != null && prev.DateEnd > current.DateStart) {
-					adjustmentRules.Remove (current);
-				}
-				prev = current;
-			}
-			return adjustmentRules;
-		}
-
 		static Dictionary<int, string> ParseAbbreviations (byte [] buffer, int index, int count)
 		{
 			var abbrevs = new Dictionary<int, string> ();
diff --git a/mcs/class/System.Data.DataSetExtensions/System.Data/ChangeLog b/mcs/class/System.Data.DataSetExtensions/System.Data/ChangeLog
index fa39725..b6c487f 100644
--- a/mcs/class/System.Data.DataSetExtensions/System.Data/ChangeLog
+++ b/mcs/class/System.Data.DataSetExtensions/System.Data/ChangeLog
@@ -1,3 +1,8 @@
+2010-03-26  Miguel de Icaza  <miguel at novell.com>
+
+	* RowEnumerableDataReader.cs: Applied patch from Tony Fish fixing
+	bug #591397
+
 2008-12-02  Marek Habersack  <mhabersack at novell.com>
 
 	* DataRowExtensions.cs: when Field <T> is specialized on a
diff --git a/mcs/class/System.Data.DataSetExtensions/System.Data/RowEnumerableDataReader.cs b/mcs/class/System.Data.DataSetExtensions/System.Data/RowEnumerableDataReader.cs
index 0e583bf..4a9e571 100644
--- a/mcs/class/System.Data.DataSetExtensions/System.Data/RowEnumerableDataReader.cs
+++ b/mcs/class/System.Data.DataSetExtensions/System.Data/RowEnumerableDataReader.cs
@@ -44,8 +44,8 @@ namespace System.Data
 		public RowEnumerableDataReader (IEnumerable source, int depth)
 		{
 			this.source = source as EnumerableRowCollection;
-			if (source == null)
-				source = new EnumerableRowCollection<DataRow> ((IEnumerable<DataRow>) source);
+			if (this.source == null)
+				this.source = new EnumerableRowCollection<DataRow> ((IEnumerable<DataRow>) source);
 			this.depth = depth;
 		}
 
@@ -158,10 +158,16 @@ namespace System.Data
 
 		public int GetValues (object [] values)
 		{
-			// FIXME: do we need it?
-			throw new NotSupportedException ();
-		}
+			int fieldCount = FieldCount;
+			int i;
 
+			//target object is byval so we can not just assign new object[] to values , calling side will not change
+			//hence copy each item into values
+			for (i = 0; i < values.Length && i < fieldCount; ++i)
+				values[i] = Current[i];
+			return i - 1;
+		}
+		
 		public bool IsDBNull (int i)
 		{
 			return Current.IsNull (i);
diff --git a/mcs/class/System.Data.Linq/ChangeLog b/mcs/class/System.Data.Linq/ChangeLog
index 5e2ffba..5a0191c 100755
--- a/mcs/class/System.Data.Linq/ChangeLog
+++ b/mcs/class/System.Data.Linq/ChangeLog
@@ -1,3 +1,8 @@
+2010-04-13  Jonathan Pryor  <jpryor at novell.com>
+
+	* src/**/*: Sync with DbLinq r1403.  This is DbLinq 0.20 + fixes.
+	  Primarily fixes sqlmetal, codegen, etc.
+
 2009-12-18  Jonathan Pryor  <jpryor at novell.com>
 
 	* src/**/*: Sync with DbLinq r1294.  This is DbLinq 0.19.  Fixes
diff --git a/mcs/class/System.Data.Linq/System.Data.Linq.dll.sources b/mcs/class/System.Data.Linq/System.Data.Linq.dll.sources
index 7c9a59b..f4ba6f6 100755
--- a/mcs/class/System.Data.Linq/System.Data.Linq.dll.sources
+++ b/mcs/class/System.Data.Linq/System.Data.Linq.dll.sources
@@ -221,6 +221,7 @@ src/DbLinq/Schema/Dbml/Adapter/EnumType.cs
 src/DbLinq/Schema/Dbml/Adapter/INamedType.cs
 src/DbLinq/Schema/Dbml/Adapter/ISimpleList.cs
 src/DbLinq/Schema/Dbml/Adapter/SpecifiedPropertyUpdater.cs
+src/DbLinq/Schema/Dbml/DatabaseSerializer.cs
 src/DbLinq/Schema/Dbml/DbmlSchema.Adapter.cs
 src/DbLinq/Schema/Dbml/DbmlSchema.cs
 src/DbLinq/Schema/Dbml/DbmlSerializer.cs
diff --git a/mcs/class/System.Data.Linq/src/DbLinq.Firebird/FirebirdSqlProvider.cs b/mcs/class/System.Data.Linq/src/DbLinq.Firebird/FirebirdSqlProvider.cs
index b2fc7bd..5a83c57 100644
--- a/mcs/class/System.Data.Linq/src/DbLinq.Firebird/FirebirdSqlProvider.cs
+++ b/mcs/class/System.Data.Linq/src/DbLinq.Firebird/FirebirdSqlProvider.cs
@@ -75,16 +75,6 @@ namespace DbLinq.Firebird
         protected override char SafeNameStartQuote { get { return ' '; } }
         protected override char SafeNameEndQuote { get { return ' '; } }
 
-        /// <summary>
-        /// MySQL is case insensitive, and names always specify a case (there is no default casing)
-        /// However, tables appear to be full lowercase
-        /// </summary>
-        /// <param name="dbName"></param>
-        /// <returns></returns>
-        protected override bool IsNameCaseSafe(string dbName)
-        {
-            return dbName == dbName.ToUpperInvariant();
-        }
 
         /// <summary>
         /// Returns a table alias
diff --git a/mcs/class/System.Data.Linq/src/DbLinq.Firebird/Properties/AssemblyInfo.cs b/mcs/class/System.Data.Linq/src/DbLinq.Firebird/Properties/AssemblyInfo.cs
index 2de7be5..a800986 100644
--- a/mcs/class/System.Data.Linq/src/DbLinq.Firebird/Properties/AssemblyInfo.cs
+++ b/mcs/class/System.Data.Linq/src/DbLinq.Firebird/Properties/AssemblyInfo.cs
@@ -42,16 +42,4 @@ using DbLinq.Factory;
 // The following GUID is for the ID of the typelib if this project is exposed to COM
 [assembly: Guid("7ad419fa-9b5c-46d6-8567-ac33f6b69833")]
 
-// Version information for an assembly consists of the following four values:
-//
-//      Major Version
-//      Minor Version 
-//      Build Number
-//      Revision
-//
-// You can specify all the values or you can default the Build and Revision Numbers 
-// by using the '*' as shown below:
-// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyFileVersion("0.19")]
-
 [assembly: DbLinq]
diff --git a/mcs/class/System.Data.Linq/src/DbLinq.Ingres/IngresSqlProvider.cs b/mcs/class/System.Data.Linq/src/DbLinq.Ingres/IngresSqlProvider.cs
index 1055044..12a04eb 100644
--- a/mcs/class/System.Data.Linq/src/DbLinq.Ingres/IngresSqlProvider.cs
+++ b/mcs/class/System.Data.Linq/src/DbLinq.Ingres/IngresSqlProvider.cs
@@ -100,11 +100,6 @@ namespace DbLinq.Ingres
             return (":" + nameBase).ToLower();
         }
 
-        protected override bool IsNameCaseSafe(string dbName)
-        {
-            return dbName == dbName.ToLower();
-        }
-
         protected override SqlStatement GetLiteralStringConcat(SqlStatement a, SqlStatement b)
         {
             // This needs to be bracketed in case subsequent functions are called upon it
diff --git a/mcs/class/System.Data.Linq/src/DbLinq.Ingres/Properties/AssemblyInfo.cs b/mcs/class/System.Data.Linq/src/DbLinq.Ingres/Properties/AssemblyInfo.cs
index 75ce1c2..770b7b0 100644
--- a/mcs/class/System.Data.Linq/src/DbLinq.Ingres/Properties/AssemblyInfo.cs
+++ b/mcs/class/System.Data.Linq/src/DbLinq.Ingres/Properties/AssemblyInfo.cs
@@ -41,13 +41,4 @@ using DbLinq.Factory;
 // The following GUID is for the ID of the typelib if this project is exposed to COM
 [assembly: Guid("d393f4ff-9bb6-42ad-bb84-d207115f48b1")]
 
-// Version information for an assembly consists of the following four values:
-//
-//      Major Version
-//      Minor Version 
-//      Build Number
-//      Revision
-//
-[assembly: AssemblyFileVersion("0.19")]
-
 [assembly: DbLinq]
diff --git a/mcs/class/System.Data.Linq/src/DbLinq.MySql/MySqlSqlProvider.cs b/mcs/class/System.Data.Linq/src/DbLinq.MySql/MySqlSqlProvider.cs
index 24a347e..aa3e5a5 100644
--- a/mcs/class/System.Data.Linq/src/DbLinq.MySql/MySqlSqlProvider.cs
+++ b/mcs/class/System.Data.Linq/src/DbLinq.MySql/MySqlSqlProvider.cs
@@ -72,16 +72,5 @@ namespace DbLinq.MySql
 
         protected override char SafeNameStartQuote { get { return '`'; } }
         protected override char SafeNameEndQuote { get { return '`'; } }
-
-        /// <summary>
-        /// MySQL is case insensitive, and names always specify a case (there is no default casing)
-        /// However, tables appear to be full lowercase
-        /// </summary>
-        /// <param name="dbName"></param>
-        /// <returns></returns>
-        protected override bool IsNameCaseSafe(string dbName)
-        {
-            return true;
-        }
     }
 }
diff --git a/mcs/class/System.Data.Linq/src/DbLinq.MySql/Properties/AssemblyInfo.cs b/mcs/class/System.Data.Linq/src/DbLinq.MySql/Properties/AssemblyInfo.cs
index 75f5d33..2d1afcc 100644
--- a/mcs/class/System.Data.Linq/src/DbLinq.MySql/Properties/AssemblyInfo.cs
+++ b/mcs/class/System.Data.Linq/src/DbLinq.MySql/Properties/AssemblyInfo.cs
@@ -41,13 +41,4 @@ using DbLinq.Factory;
 // The following GUID is for the ID of the typelib if this project is exposed to COM
 [assembly: Guid("c8c37bc2-84ee-41b0-893e-02b4375eabbe")]
 
-// Version information for an assembly consists of the following four values:
-//
-//      Major Version
-//      Minor Version 
-//      Build Number
-//      Revision
-//
-[assembly: AssemblyFileVersion("0.19")]
-
 [assembly: DbLinq]
diff --git a/mcs/class/System.Data.Linq/src/DbLinq.Oracle/OracleSchemaLoader.Constraints.cs b/mcs/class/System.Data.Linq/src/DbLinq.Oracle/OracleSchemaLoader.Constraints.cs
index d941456..5f5618b 100644
--- a/mcs/class/System.Data.Linq/src/DbLinq.Oracle/OracleSchemaLoader.Constraints.cs
+++ b/mcs/class/System.Data.Linq/src/DbLinq.Oracle/OracleSchemaLoader.Constraints.cs
@@ -26,6 +26,7 @@
 using System;
 using System.Collections.Generic;
 using System.Data;
+using System.Linq;
 using System.Text;
 using System.Text.RegularExpressions;
 using DbLinq.Util;
@@ -39,30 +40,18 @@ namespace DbLinq.Oracle
             public string TableSchema;
             public string ConstraintName;
             public string TableName;
-            public string ColumnName;
+            public List<string> ColumnNames = new List<string>();
+            public string ColumnNameList { get { return string.Join(",", ColumnNames.ToArray()); } }
             public string ConstraintType;
             public string ReverseConstraintName;
             public string Expression;
 
             public override string ToString()
             {
-                return "User_Constraint  " + TableName + "." + ColumnName;
+                return "User_Constraint  " + TableName + "." + ColumnNameList;
             }
         }
 
-        protected virtual DataConstraint ReadConstraint(IDataReader rdr)
-        {
-            var constraint = new DataConstraint();
-            int field = 0;
-            constraint.TableSchema = rdr.GetAsString(field++);
-            constraint.ConstraintName = rdr.GetAsString(field++);
-            constraint.TableName = rdr.GetAsString(field++);
-            constraint.ColumnName = rdr.GetAsString(field++);
-            constraint.ConstraintType = rdr.GetAsString(field++);
-            constraint.ReverseConstraintName = rdr.GetAsString(field++);
-            return constraint;
-        }
-
         private static Regex TriggerMatch1 = new Regex(@".*SELECT\s+(?<exp>\S+.*)\s+INTO\s+\:new.(?<col>\S+)\s+FROM\s+DUAL.*",
             RegexOptions.Compiled | RegexOptions.IgnoreCase);
 
@@ -97,7 +86,7 @@ namespace DbLinq.Oracle
             string expression, column;
             if (MatchTrigger(TriggerMatch1, body, out expression, out column))
             {
-                constraint.ColumnName = column.Trim('"');
+                constraint.ColumnNames.Add(column.Trim('"'));
                 constraint.Expression = expression;
             }
             return constraint;
@@ -108,15 +97,41 @@ namespace DbLinq.Oracle
             var constraints = new List<DataConstraint>();
 
             string sql = @"
-SELECT UCC.owner, UCC.constraint_name, UCC.table_name, UCC.column_name, UC.constraint_type, UC.R_constraint_name
+SELECT UCC.owner, UCC.constraint_name, UCC.table_name, UC.constraint_type, UC.R_constraint_name, UCC.column_name, UCC.position
 FROM all_cons_columns UCC, all_constraints UC
 WHERE UCC.constraint_name=UC.constraint_name
 AND UCC.table_name=UC.table_name
+AND UCC.owner=UC.owner
 AND UCC.TABLE_NAME NOT LIKE '%$%' AND UCC.TABLE_NAME NOT LIKE 'LOGMNR%' AND UCC.TABLE_NAME NOT IN ('HELP','SQLPLUS_PRODUCT_PROFILE')
 AND UC.CONSTRAINT_TYPE!='C'
 and lower(UCC.owner) = :owner";
 
-            constraints.AddRange(DataCommand.Find<DataConstraint>(conn, sql, ":owner", db.ToLower(), ReadConstraint));
+            constraints.AddRange(DataCommand.Find(conn, sql, ":owner", db.ToLower(),
+                    r => new
+                    {
+                        Key = new
+                        {
+                            Owner = r.GetString(0),
+                            ConName = r.GetString(1),
+                            TableName = r.GetString(2),
+                            ConType = r.GetString(3),
+                            RevCconName = r.GetAsString(4)
+                        },
+                        Value = new
+                        {
+                            ColName = r.GetString(5),
+                            ColPos = r.GetInt32(6)
+                        }
+                    })
+                .GroupBy(r => r.Key, r => r.Value, (r, rs) => new DataConstraint
+                {
+                    TableSchema = r.Owner,
+                    ConstraintName = r.ConName,
+                    TableName = r.TableName,
+                    ConstraintType = r.ConType,
+                    ReverseConstraintName = r.RevCconName,
+                    ColumnNames = rs.OrderBy(t => t.ColPos).Select(t => t.ColName).ToList()
+                }));
 
             string sql2 =
                 @"
diff --git a/mcs/class/System.Data.Linq/src/DbLinq.Oracle/OracleSchemaLoader.cs b/mcs/class/System.Data.Linq/src/DbLinq.Oracle/OracleSchemaLoader.cs
index 41e3690..d6e56a9 100644
--- a/mcs/class/System.Data.Linq/src/DbLinq.Oracle/OracleSchemaLoader.cs
+++ b/mcs/class/System.Data.Linq/src/DbLinq.Oracle/OracleSchemaLoader.cs
@@ -51,7 +51,7 @@ namespace DbLinq.Oracle
                 DbLinq.Schema.Dbml.Table table = schema.Tables.FirstOrDefault(t => constraintFullDbName == t.Name);
                 if (table == null)
                 {
-                    WriteErrorLine("ERROR L100: Table '" + constraint.TableName + "' not found for column " + constraint.ColumnName);
+                    WriteErrorLine("ERROR L100: Table '" + constraint.TableName + "' not found for column " + constraint.ColumnNameList);
                     continue;
                 }
 
@@ -61,7 +61,7 @@ namespace DbLinq.Oracle
                 if (constraint.ConstraintType == "P")
                 {
                     //A) add primary key
-                    DbLinq.Schema.Dbml.Column pkColumn = table.Type.Columns.Where(c => c.Name == constraint.ColumnName).First();
+                    DbLinq.Schema.Dbml.Column pkColumn = table.Type.Columns.Where(c => constraint.ColumnNames.Contains(c.Name)).First();
                     pkColumn.IsPrimaryKey = true;
                 }
                 else if (constraint.ConstraintType == "R")
@@ -75,16 +75,16 @@ namespace DbLinq.Oracle
                         continue;
                     }
 
-                    LoadForeignKey(schema, table, constraint.ColumnName, constraint.TableName, constraint.TableSchema,
-                                   referencedConstraint.ColumnName, referencedConstraint.TableName,
+                    LoadForeignKey(schema, table, constraint.ColumnNameList, constraint.TableName, constraint.TableSchema,
+                                   referencedConstraint.ColumnNameList, referencedConstraint.TableName,
                                    referencedConstraint.TableSchema,
                                    constraint.ConstraintName, nameFormat, names);
 
                 }
                 // custom type, this is a trigger
-                else if (constraint.ConstraintType == "T" && constraint.ColumnName != null)
+                else if (constraint.ConstraintType == "T" && constraint.ColumnNames.Count == 1)
                 {
-                    var column = table.Type.Columns.Where(c => c.Name == constraint.ColumnName).First();
+                    var column = table.Type.Columns.Where(c => c.Name == constraint.ColumnNames[0]).First();
                     column.Expression = constraint.Expression;
                     column.IsDbGenerated = true;
                 }
diff --git a/mcs/class/System.Data.Linq/src/DbLinq.Oracle/Properties/AssemblyInfo.cs b/mcs/class/System.Data.Linq/src/DbLinq.Oracle/Properties/AssemblyInfo.cs
index 9a78b7b..505b7c1 100644
--- a/mcs/class/System.Data.Linq/src/DbLinq.Oracle/Properties/AssemblyInfo.cs
+++ b/mcs/class/System.Data.Linq/src/DbLinq.Oracle/Properties/AssemblyInfo.cs
@@ -41,13 +41,4 @@ using DbLinq.Factory;
 // The following GUID is for the ID of the typelib if this project is exposed to COM
 [assembly: Guid("e1f0992f-a414-4479-905e-96c5d51b8cb6")]
 
-// Version information for an assembly consists of the following four values:
-//
-//      Major Version
-//      Minor Version 
-//      Build Number
-//      Revision
-//
-[assembly: AssemblyFileVersion("0.19")]
-
 [assembly: DbLinq]
diff --git a/mcs/class/System.Data.Linq/src/DbLinq.PostgreSql/PgsqlSchemaLoader.cs b/mcs/class/System.Data.Linq/src/DbLinq.PostgreSql/PgsqlSchemaLoader.cs
index 0778a6b..12270e7 100644
--- a/mcs/class/System.Data.Linq/src/DbLinq.PostgreSql/PgsqlSchemaLoader.cs
+++ b/mcs/class/System.Data.Linq/src/DbLinq.PostgreSql/PgsqlSchemaLoader.cs
@@ -106,7 +106,7 @@ namespace DbLinq.PostgreSql
                 //In Sasha's DB, they don't end with "_pkey", you need to rely on ReadForeignConstraints().
                 //In Northwind, they do end with "_pkey".
                 bool isPrimaryKey = keyColRow.ConstraintName.EndsWith("_pkey")
-                    || primaryKeys.Count(k => k.ConstraintName == keyColRow.ConstraintName) == 1;
+                    || primaryKeys.Count(k => k.ConstraintName == keyColRow.ConstraintName) > 0;
 
                 if (isPrimaryKey)
                 {
diff --git a/mcs/class/System.Data.Linq/src/DbLinq.PostgreSql/PgsqlSqlProvider.cs b/mcs/class/System.Data.Linq/src/DbLinq.PostgreSql/PgsqlSqlProvider.cs
index a546ec5..e86a06a 100644
--- a/mcs/class/System.Data.Linq/src/DbLinq.PostgreSql/PgsqlSqlProvider.cs
+++ b/mcs/class/System.Data.Linq/src/DbLinq.PostgreSql/PgsqlSqlProvider.cs
@@ -145,15 +145,5 @@ namespace DbLinq.PostgreSql
 
             return string.Format("({0})::{1}", a, sqlTypeName);
         }
-
-        /// <summary>
-        /// In PostgreSQL an insensitive name is lowercase
-        /// </summary>
-        /// <param name="dbName"></param>
-        /// <returns></returns>
-        protected override bool IsNameCaseSafe(string dbName)
-        {
-            return dbName == dbName.ToLower();
-        }
     }
 }
diff --git a/mcs/class/System.Data.Linq/src/DbLinq.PostgreSql/Properties/AssemblyInfo.cs b/mcs/class/System.Data.Linq/src/DbLinq.PostgreSql/Properties/AssemblyInfo.cs
index 75ce1c2..770b7b0 100644
--- a/mcs/class/System.Data.Linq/src/DbLinq.PostgreSql/Properties/AssemblyInfo.cs
+++ b/mcs/class/System.Data.Linq/src/DbLinq.PostgreSql/Properties/AssemblyInfo.cs
@@ -41,13 +41,4 @@ using DbLinq.Factory;
 // The following GUID is for the ID of the typelib if this project is exposed to COM
 [assembly: Guid("d393f4ff-9bb6-42ad-bb84-d207115f48b1")]
 
-// Version information for an assembly consists of the following four values:
-//
-//      Major Version
-//      Minor Version 
-//      Build Number
-//      Revision
-//
-[assembly: AssemblyFileVersion("0.19")]
-
 [assembly: DbLinq]
diff --git a/mcs/class/System.Data.Linq/src/DbLinq.ProductInfo.cs b/mcs/class/System.Data.Linq/src/DbLinq.ProductInfo.cs
index a8e46b7..dce8d43 100644
--- a/mcs/class/System.Data.Linq/src/DbLinq.ProductInfo.cs
+++ b/mcs/class/System.Data.Linq/src/DbLinq.ProductInfo.cs
@@ -45,4 +45,5 @@ using System.Runtime.InteropServices;
 //      Build Number
 //      Revision
 //
-[assembly: AssemblyVersion("0.19")]
+[assembly: AssemblyFileVersion("0.20")]
+[assembly: AssemblyVersion("0.20")]
diff --git a/mcs/class/System.Data.Linq/src/DbLinq.SqlServer/Properties/AssemblyInfo.cs b/mcs/class/System.Data.Linq/src/DbLinq.SqlServer/Properties/AssemblyInfo.cs
index cd372ea..8a1049d 100644
--- a/mcs/class/System.Data.Linq/src/DbLinq.SqlServer/Properties/AssemblyInfo.cs
+++ b/mcs/class/System.Data.Linq/src/DbLinq.SqlServer/Properties/AssemblyInfo.cs
@@ -41,13 +41,4 @@ using DbLinq.Factory;
 // The following GUID is for the ID of the typelib if this project is exposed to COM
 [assembly: Guid("55bd884f-8aa6-4dbb-8d29-2d8e879e5f0b")]
 
-// Version information for an assembly consists of the following four values:
-//
-//      Major Version
-//      Minor Version 
-//      Build Number
-//      Revision
-//
-[assembly: AssemblyFileVersion("0.19")]
-
 [assembly: DbLinq]
diff --git a/mcs/class/System.Data.Linq/src/DbLinq.SqlServer/SqlServerVendor.cs b/mcs/class/System.Data.Linq/src/DbLinq.SqlServer/SqlServerVendor.cs
index 7b884ee..de092b3 100644
--- a/mcs/class/System.Data.Linq/src/DbLinq.SqlServer/SqlServerVendor.cs
+++ b/mcs/class/System.Data.Linq/src/DbLinq.SqlServer/SqlServerVendor.cs
@@ -62,6 +62,13 @@ namespace DbLinq.SqlServer
         protected readonly SqlServerSqlProvider sqlProvider = new SqlServerSqlProvider();
         public override ISqlProvider SqlProvider { get { return sqlProvider; } }
 
+        protected override void AppendServer(StringBuilder connectionString, string host)
+        {
+            // As per http://www.connectionstrings.com/sql-server, 
+            // port numbers are separated from host names via comma
+            AppendConnectionString(connectionString, ConnectionStringServer, host.Replace(':', ','));
+        }
+
         //NOTE: for Oracle, we want to consider 'Array Binding'
         //http://download-west.oracle.com/docs/html/A96160_01/features.htm#1049674
 
@@ -91,6 +98,11 @@ namespace DbLinq.SqlServer
                 var dc = new DataColumn();
                 dc.ColumnName = column.MappedName;
                 dc.DataType = column.Member.GetMemberType();
+                if (dc.DataType.IsNullable())
+                {
+                    dc.AllowDBNull  = true;
+                    dc.DataType     = dc.DataType.GetNullableType();
+                }
                 dt.Columns.Add(dc);
             }
 
@@ -105,7 +117,7 @@ namespace DbLinq.SqlServer
                     //if (pair.Value.IsDbGenerated)
                     //    continue; //don't assign IDENTITY col
                     object value = pair.Member.GetMemberValue(row);
-                    dr[pair.MappedName] = value;
+                    dr[pair.MappedName] = value ?? DBNull.Value;
                 }
                 //dr[1
                 dt.Rows.Add(dr);
diff --git a/mcs/class/System.Data.Linq/src/DbLinq.Sqlite/Properties/AssemblyInfo.cs b/mcs/class/System.Data.Linq/src/DbLinq.Sqlite/Properties/AssemblyInfo.cs
index 715ab5b..2b949b1 100644
--- a/mcs/class/System.Data.Linq/src/DbLinq.Sqlite/Properties/AssemblyInfo.cs
+++ b/mcs/class/System.Data.Linq/src/DbLinq.Sqlite/Properties/AssemblyInfo.cs
@@ -41,13 +41,4 @@ using DbLinq.Factory;
 // The following GUID is for the ID of the typelib if this project is exposed to COM
 [assembly: Guid("9a57ce12-ad10-479f-b181-eb267c8e6c19")]
 
-// Version information for an assembly consists of the following four values:
-//
-//      Major Version
-//      Minor Version 
-//      Build Number
-//      Revision
-//
-[assembly: AssemblyFileVersion("0.19")]
-
 [assembly: DbLinq]
diff --git a/mcs/class/System.Data.Linq/src/DbLinq.Sqlite/SqliteSchemaLoader.Columns.cs b/mcs/class/System.Data.Linq/src/DbLinq.Sqlite/SqliteSchemaLoader.Columns.cs
index be8e02a..2df555d 100644
--- a/mcs/class/System.Data.Linq/src/DbLinq.Sqlite/SqliteSchemaLoader.Columns.cs
+++ b/mcs/class/System.Data.Linq/src/DbLinq.Sqlite/SqliteSchemaLoader.Columns.cs
@@ -49,7 +49,7 @@ namespace DbLinq.Sqlite
 
         protected override IList<IDataTableColumn> ReadColumns(IDbConnection connectionString, string databaseName)
         {
-            const string sql = @" SELECT tbl_name FROM sqlite_master WHERE type='table' order by tbl_name";
+            var sql = string.Format(SelectTablesFormat, "");
             const string pragma = @"PRAGMA table_info('{0}');";
 
             return Schema.DataCommand.Find<IDataTableColumn>(connectionString, sql, pragma, ReadColumn);
diff --git a/mcs/class/System.Data.Linq/src/DbLinq.Sqlite/SqliteSchemaLoader.Tables.cs b/mcs/class/System.Data.Linq/src/DbLinq.Sqlite/SqliteSchemaLoader.Tables.cs
index 6f50e1a..88b9c8f 100644
--- a/mcs/class/System.Data.Linq/src/DbLinq.Sqlite/SqliteSchemaLoader.Tables.cs
+++ b/mcs/class/System.Data.Linq/src/DbLinq.Sqlite/SqliteSchemaLoader.Tables.cs
@@ -33,9 +33,7 @@ namespace DbLinq.Sqlite
     {
         public override IList<IDataName> ReadTables(IDbConnection connectionString, string databaseName)
         {
-            // note: the ReadDataNameAndSchema relies on information order
-            const string sql = @" SELECT tbl_name, 'main' FROM sqlite_master WHERE type='table' order by tbl_name";
-
+            string sql = string.Format(SelectTablesFormat, ", 'main'");
             return Util.DataCommand.Find<IDataName>(connectionString, sql, ReadDataNameAndSchema);
         }
     }
diff --git a/mcs/class/System.Data.Linq/src/DbLinq.Sqlite/SqliteSchemaLoader.cs b/mcs/class/System.Data.Linq/src/DbLinq.Sqlite/SqliteSchemaLoader.cs
index 2278bec..ceb44af 100644
--- a/mcs/class/System.Data.Linq/src/DbLinq.Sqlite/SqliteSchemaLoader.cs
+++ b/mcs/class/System.Data.Linq/src/DbLinq.Sqlite/SqliteSchemaLoader.cs
@@ -58,6 +58,16 @@ namespace DbLinq.Sqlite
             return name;
         }
 
+        // note: the ReadDataNameAndSchema relies on information order;
+        // tbl_name MUST be first
+        const string SelectTablesFormat = 
+@"   SELECT tbl_name{0}
+       FROM sqlite_master
+      WHERE type='table' AND
+            tbl_name NOT LIKE 'sqlite_%'
+   ORDER BY tbl_name";
+
+
         /// <summary>
         /// Gets a usable name for the database.
         /// </summary>
diff --git a/mcs/class/System.Data.Linq/src/DbLinq.Sqlite/SqliteSqlProvider.cs b/mcs/class/System.Data.Linq/src/DbLinq.Sqlite/SqliteSqlProvider.cs
index d932994..55f690b 100644
--- a/mcs/class/System.Data.Linq/src/DbLinq.Sqlite/SqliteSqlProvider.cs
+++ b/mcs/class/System.Data.Linq/src/DbLinq.Sqlite/SqliteSqlProvider.cs
@@ -60,11 +60,6 @@ namespace DbLinq.Sqlite
             return "COUNT(*)";
         }
 
-        protected override bool IsNameCaseSafe(string namePart)
-        {
-            return true;
-        }
-
         public override SqlStatement GetLiteral(bool literal)
         {
             if (literal)
diff --git a/mcs/class/System.Data.Linq/src/DbLinq/Data/Linq/DataContext.cs b/mcs/class/System.Data.Linq/src/DbLinq/Data/Linq/DataContext.cs
index 838d2b0..9710a8a 100644
--- a/mcs/class/System.Data.Linq/src/DbLinq/Data/Linq/DataContext.cs
+++ b/mcs/class/System.Data.Linq/src/DbLinq/Data/Linq/DataContext.cs
@@ -236,18 +236,18 @@ namespace DbLinq.Data.Linq
             System.Text.RegularExpressions.Regex reProvider
                 = new System.Text.RegularExpressions.Regex(@"DbLinqProvider=([\w\.]+);?");
 
-            string assemblyFile = null;
+            string assemblyName = null;
             string vendor;
             if (!reProvider.IsMatch(connectionString))
             {
                 vendor       = "SqlServer";
-                assemblyFile = "DbLinq.SqlServer.dll";
+                assemblyName = "DbLinq.SqlServer";
             }
             else
             {
                 var match    = reProvider.Match(connectionString);
                 vendor       = match.Groups[1].Value;
-                assemblyFile = "DbLinq." + vendor + ".dll";
+                assemblyName = "DbLinq." + vendor;
 
                 //plain DbLinq - non MONO: 
                 //IVendor classes are in DLLs such as "DbLinq.MySql.dll"
@@ -268,16 +268,15 @@ namespace DbLinq.Data.Linq
 #if MONO_STRICT
                 assembly = typeof (DataContext).Assembly; // System.Data.Linq.dll
 #else
-                //TODO: check if DLL is already loaded?
-                assembly = Assembly.LoadFrom(assemblyFile);
+                assembly = Assembly.Load(assemblyName);
 #endif
             }
             catch (Exception e)
             {
                 throw new ArgumentException(
                         string.Format(
-                            "Unable to load the `{0}' DbLinq vendor within assembly `{1}'.",
-                            assemblyFile, vendor),
+                            "Unable to load the `{0}' DbLinq vendor within assembly '{1}.dll'.",
+                            assemblyName, vendor),
                         "connectionString", e);
             }
         }
@@ -399,11 +398,11 @@ namespace DbLinq.Data.Linq
                     SubmitChangesImpl(failureMode);
                 else
                 {
-                    using (IDatabaseTransaction transaction = DatabaseContext.Transaction())
+                    using (IDbTransaction transaction = DatabaseContext.CreateTransaction())
                     {
                         try
                         {
-                            Transaction = (DbTransaction) transaction.Transaction;
+                            Transaction = (DbTransaction) transaction;
                             SubmitChangesImpl(failureMode);
                             // TODO: handle conflicts (which can only occur when concurrency mode is implemented)
                             transaction.Commit();
@@ -1025,7 +1024,10 @@ namespace DbLinq.Data.Linq
 			set { throw new NotImplementedException(); }
 		}
 
-        public DbTransaction Transaction { get; set; }
+        public DbTransaction Transaction {
+            get { return (DbTransaction) DatabaseContext.CurrentTransaction; }
+            set { DatabaseContext.CurrentTransaction = value; }
+        }
 
         /// <summary>
         /// Runs the given reader and returns columns.
diff --git a/mcs/class/System.Data.Linq/src/DbLinq/Data/Linq/Database/IDatabaseContext.cs b/mcs/class/System.Data.Linq/src/DbLinq/Data/Linq/Database/IDatabaseContext.cs
index 97fc4ec..9d8fae8 100644
--- a/mcs/class/System.Data.Linq/src/DbLinq/Data/Linq/Database/IDatabaseContext.cs
+++ b/mcs/class/System.Data.Linq/src/DbLinq/Data/Linq/Database/IDatabaseContext.cs
@@ -63,7 +63,10 @@ namespace DbLinq.Data.Linq.Database
         /// Creates a transaction.
         /// </summary>
         /// <returns></returns>
-        IDatabaseTransaction Transaction();
+        IDbTransaction CreateTransaction();
+
+        IDbTransaction CurrentTransaction { get; set; }
+
         /// <summary>
         /// Opens a connection.
         /// </summary>
diff --git a/mcs/class/System.Data.Linq/src/DbLinq/Data/Linq/Database/Implementation/DatabaseContext.cs b/mcs/class/System.Data.Linq/src/DbLinq/Data/Linq/Database/Implementation/DatabaseContext.cs
index 1a1e790..3bf55cd 100644
--- a/mcs/class/System.Data.Linq/src/DbLinq/Data/Linq/Database/Implementation/DatabaseContext.cs
+++ b/mcs/class/System.Data.Linq/src/DbLinq/Data/Linq/Database/Implementation/DatabaseContext.cs
@@ -44,6 +44,8 @@ namespace DbLinq.Data.Linq.Database.Implementation
             set { ChangeConnection(value, false); }
         }
 
+        public IDbTransaction CurrentTransaction { get; set; }
+
         private readonly DbProviderFactory _providerFactory;
         /// <summary>
         /// Gets the provider factory.
@@ -101,9 +103,11 @@ namespace DbLinq.Data.Linq.Database.Implementation
         /// Creates a transaction.
         /// </summary>
         /// <returns></returns>
-        public IDatabaseTransaction Transaction()
+        public IDbTransaction CreateTransaction()
         {
-            return new DatabaseTransaction(Connection);
+            if (CurrentTransaction != null)
+                throw new InvalidOperationException("Attempting to create a transaction while within a transaction.");
+            return CurrentTransaction = Connection.BeginTransaction();
         }
 
         /// <summary>
@@ -114,7 +118,7 @@ namespace DbLinq.Data.Linq.Database.Implementation
         {
             IDbCommand command = Connection.CreateCommand();
             if (command.Transaction == null)
-                command.Transaction = DatabaseTransaction.currentTransaction;
+                command.Transaction = CurrentTransaction;
             return command;
         }
 
diff --git a/mcs/class/System.Data.Linq/src/DbLinq/Data/Linq/Database/Implementation/TransactionalCommand.cs b/mcs/class/System.Data.Linq/src/DbLinq/Data/Linq/Database/Implementation/TransactionalCommand.cs
index f4a1475..fab34f7 100644
--- a/mcs/class/System.Data.Linq/src/DbLinq/Data/Linq/Database/Implementation/TransactionalCommand.cs
+++ b/mcs/class/System.Data.Linq/src/DbLinq/Data/Linq/Database/Implementation/TransactionalCommand.cs
@@ -47,7 +47,7 @@ namespace DbLinq.Data.Linq.Database.Implementation
         /// <summary>
         /// Ambient transaction
         /// </summary>
-        private readonly IDatabaseTransaction _transaction;
+        private readonly IDbTransaction _transaction;
 
         private readonly IDbCommand _command;
 
@@ -100,8 +100,8 @@ namespace DbLinq.Data.Linq.Database.Implementation
             // the transaction is optional
             if (createTransaction && !haveHigherTransaction)
             {
-                _transaction = dataContext.DatabaseContext.Transaction();
-                _command.Transaction = _transaction.Transaction;
+                _transaction = dataContext.DatabaseContext.CreateTransaction();
+                _command.Transaction = _transaction;
             }
             else
                 _command.Transaction = dataContext.Transaction;
diff --git a/mcs/class/System.Data.Linq/src/DbLinq/Data/Linq/Mapping/XmlMappingSource.cs b/mcs/class/System.Data.Linq/src/DbLinq/Data/Linq/Mapping/XmlMappingSource.cs
index 28f4f97..329a974 100644
--- a/mcs/class/System.Data.Linq/src/DbLinq/Data/Linq/Mapping/XmlMappingSource.cs
+++ b/mcs/class/System.Data.Linq/src/DbLinq/Data/Linq/Mapping/XmlMappingSource.cs
@@ -184,7 +184,7 @@ namespace DbLinq.Data.Linq.Mapping
             }
             public bool GetBooleanAttribute(XmlReader r, string attributeName)
             {
-                return r.GetAttribute(attributeName) == "true";
+                return string.Compare(r.GetAttribute(attributeName), "true", StringComparison.OrdinalIgnoreCase) == 0;
             }
             public UpdateCheck GetUpdateCheckAttribute(XmlReader r, string attributeName)
             {
diff --git a/mcs/class/System.Data.Linq/src/DbLinq/Data/Linq/Sugar/Implementation/ExpressionDispatcher.Registrar.cs b/mcs/class/System.Data.Linq/src/DbLinq/Data/Linq/Sugar/Implementation/ExpressionDispatcher.Registrar.cs
index 187a5e8..36f2bd0 100644
--- a/mcs/class/System.Data.Linq/src/DbLinq/Data/Linq/Sugar/Implementation/ExpressionDispatcher.Registrar.cs
+++ b/mcs/class/System.Data.Linq/src/DbLinq/Data/Linq/Sugar/Implementation/ExpressionDispatcher.Registrar.cs
@@ -271,13 +271,13 @@ namespace DbLinq.Data.Linq.Sugar.Implementation
 
             // our table is created, with the expressions
             // now check if we didn't register exactly the same
-            if ((from t in builderContext.EnumerateScopeTables() where t.IsEqualTo(otherTableExpression) select t).SingleOrDefault() == null)
-            {
-                builderContext.CurrentSelect.Tables.Add(otherTableExpression);
-                foreach (var createdColumn in createdColumns)
-                    builderContext.CurrentSelect.Columns.Add(createdColumn);
-            }
-
+            var existingTable = (from t in builderContext.EnumerateScopeTables() where t.IsEqualTo(otherTableExpression) select t).SingleOrDefault();
+            if (existingTable != null)
+                return existingTable;
+ 
+            builderContext.CurrentSelect.Tables.Add(otherTableExpression);
+            foreach (var createdColumn in createdColumns)
+                builderContext.CurrentSelect.Columns.Add(createdColumn);
             return otherTableExpression;
         }
 
diff --git a/mcs/class/System.Data.Linq/src/DbLinq/Data/Linq/Sugar/Implementation/QueryBuilder.cs b/mcs/class/System.Data.Linq/src/DbLinq/Data/Linq/Sugar/Implementation/QueryBuilder.cs
index 8fa90b9..6250502 100644
--- a/mcs/class/System.Data.Linq/src/DbLinq/Data/Linq/Sugar/Implementation/QueryBuilder.cs
+++ b/mcs/class/System.Data.Linq/src/DbLinq/Data/Linq/Sugar/Implementation/QueryBuilder.cs
@@ -402,9 +402,27 @@ namespace DbLinq.Data.Linq.Sugar.Implementation
                     SetInSelectCache(expressions, query);
                 }
             }
+            else if (query.InputParameters.Count > 0)
+            {
+                Profiler.At("START: GetSelectQuery(), building Expression parameters of cached query");
+                var parameters = BuildExpressionParameters(expressions, queryContext);
+                query = new SelectQuery(queryContext.DataContext, query.Sql, parameters, query.RowObjectCreator, query.ExecuteMethodName);
+                Profiler.At("END: GetSelectQuery(), building Expression parameters of cached query");
+            }
             return query;
         }
 
+        IList<InputParameterExpression> BuildExpressionParameters(ExpressionChain expressions, QueryContext queryContext)
+        {
+            var builderContext = new BuilderContext(queryContext);
+            var previousExpression = ExpressionDispatcher.CreateTableExpression(expressions.Expressions[0], builderContext);
+            previousExpression = BuildExpressionQuery(expressions, previousExpression, builderContext);
+            BuildOffsetsAndLimits(builderContext);
+            // then prepare Parts for SQL translation
+            PrepareSqlOperands(builderContext);
+            return builderContext.ExpressionQuery.Parameters;
+        }
+
         /// <summary>
         /// Returns a Delegate to create a row for a given IDataRecord
         /// The Delegate is Func<IDataRecord,MappingContext,"tableType">
diff --git a/mcs/class/System.Data.Linq/src/DbLinq/Data/Linq/Table.Extended.cs b/mcs/class/System.Data.Linq/src/DbLinq/Data/Linq/Table.Extended.cs
index 0e7b604..6790688 100644
--- a/mcs/class/System.Data.Linq/src/DbLinq/Data/Linq/Table.Extended.cs
+++ b/mcs/class/System.Data.Linq/src/DbLinq/Data/Linq/Table.Extended.cs
@@ -76,9 +76,9 @@ namespace DbLinq.Data.Linq
         public void BulkInsert(IEnumerable<TEntity> entities, int pageSize)
         {
             using (Context.DatabaseContext.OpenConnection())
-            using (var transaction = Context.DatabaseContext.Transaction())
+            using (var transaction = Context.DatabaseContext.CreateTransaction())
             {
-                Context.Vendor.BulkInsert(this, entities.ToList(), pageSize, transaction.Transaction);
+                Context.Vendor.BulkInsert(this, entities.ToList(), pageSize, Context.Transaction);
                 transaction.Commit();
             }
         }
diff --git a/mcs/class/System.Data.Linq/src/DbLinq/Properties/AssemblyInfo.cs b/mcs/class/System.Data.Linq/src/DbLinq/Properties/AssemblyInfo.cs
index fe34254..af42206 100644
--- a/mcs/class/System.Data.Linq/src/DbLinq/Properties/AssemblyInfo.cs
+++ b/mcs/class/System.Data.Linq/src/DbLinq/Properties/AssemblyInfo.cs
@@ -42,15 +42,6 @@ using DbLinq.Factory;
 // The following GUID is for the ID of the typelib if this project is exposed to COM
 [assembly: Guid("e2381b27-cdb0-401d-9019-f72079b4928d")]
 
-// Version information for an assembly consists of the following four values:
-//
-//      Major Version
-//      Minor Version 
-//      Build Number
-//      Revision
-//
-[assembly: AssemblyFileVersion("0.19")]
-
 [assembly: DbLinq]
 
 // Regarding tests, it is mandatory, since we test internals
@@ -112,6 +103,13 @@ using DbLinq.Factory;
 + "962a12b830c2a70eb70ec77823eb5750e5bdef9e01d097c30b5c5463c3d07d3472b58e4c02f279"
 + "2309259f")]
 
+[assembly: InternalsVisibleTo("DbLinq.SqlServer, PublicKey="
++ "0024000004800000940000000602000000240000525341310004000001000100c5753d8c47f400"
++ "83f549016a5711238ac8ec297605abccd3dc4b6d0f280b4764eb2cc58ec4e37831edad7e7a07b8"
++ "fe4a9cbb059374c0cc047aa28839fed7176761813caf6a2ffa0bff9afb50ead56dd3f56186a663"
++ "962a12b830c2a70eb70ec77823eb5750e5bdef9e01d097c30b5c5463c3d07d3472b58e4c02f279"
++ "2309259f")]
+
 [assembly: InternalsVisibleTo("DbLinq.Ingres, PublicKey="
 + "0024000004800000940000000602000000240000525341310004000001000100c5753d8c47f400"
 + "83f549016a5711238ac8ec297605abccd3dc4b6d0f280b4764eb2cc58ec4e37831edad7e7a07b8"
diff --git a/mcs/class/System.Data.Linq/src/DbLinq/Schema/Dbml/DatabaseSerializer.cs b/mcs/class/System.Data.Linq/src/DbLinq/Schema/Dbml/DatabaseSerializer.cs
new file mode 100644
index 0000000..073eef9
--- /dev/null
+++ b/mcs/class/System.Data.Linq/src/DbLinq/Schema/Dbml/DatabaseSerializer.cs
@@ -0,0 +1,2223 @@
+// It is automatically generated
+using System;
+using System.Xml;
+using System.Xml.Schema;
+using System.Xml.Serialization;
+using System.Text;
+using System.Collections;
+using System.Globalization;
+
+namespace DbLinq.Schema.Dbml
+{
+	#if !MONO_STRICT
+	public
+	#endif
+	class GeneratedReader : XmlSerializationReader
+	{
+		static readonly System.Reflection.MethodInfo fromBinHexStringMethod = typeof (XmlConvert).GetMethod ("FromBinHexString", System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.NonPublic, null, new System.Type [] {typeof (string)}, null);
+		static byte [] FromBinHexString (string input)
+		{
+			return input == null ? null : (byte []) fromBinHexStringMethod.Invoke (null, new object [] {input});
+		}
+		public object ReadRoot_Database ()
+		{
+			Reader.MoveToContent();
+			if (Reader.LocalName != "Database" || Reader.NamespaceURI != "http://schemas.microsoft.com/linqtosql/dbml/2007")
+				throw CreateUnknownNodeException();
+			return ReadObject_Database (false, true);
+		}
+
+		public DbLinq.Schema.Dbml.Database ReadObject_Database (bool isNullable, bool checkType)
+		{
+			DbLinq.Schema.Dbml.Database ob = null;
+			if (isNullable && ReadNull()) return null;
+
+			if (checkType) 
+			{
+				System.Xml.XmlQualifiedName t = GetXsiType();
+				if (t == null)
+				{ }
+				else if (t.Name != "Database" || t.Namespace != "http://schemas.microsoft.com/linqtosql/dbml/2007")
+					throw CreateUnknownTypeException(t);
+			}
+
+			ob = (DbLinq.Schema.Dbml.Database) Activator.CreateInstance(typeof(DbLinq.Schema.Dbml.Database), true);
+
+			Reader.MoveToElement();
+
+			while (Reader.MoveToNextAttribute())
+			{
+				if (Reader.LocalName == "Name" && Reader.NamespaceURI == "") {
+					ob. at Name = Reader.Value;
+				}
+				else if (Reader.LocalName == "EntityNamespace" && Reader.NamespaceURI == "") {
+					ob. at EntityNamespace = Reader.Value;
+				}
+				else if (Reader.LocalName == "ContextNamespace" && Reader.NamespaceURI == "") {
+					ob. at ContextNamespace = Reader.Value;
+				}
+				else if (Reader.LocalName == "Class" && Reader.NamespaceURI == "") {
+					ob. at Class = Reader.Value;
+				}
+				else if (Reader.LocalName == "AccessModifier" && Reader.NamespaceURI == "") {
+					ob. at AccessModifier = GetEnumValue_AccessModifier (Reader.Value);
+					ob.AccessModifierSpecified = true;
+				}
+				else if (Reader.LocalName == "Modifier" && Reader.NamespaceURI == "") {
+					ob. at Modifier = GetEnumValue_ClassModifier (Reader.Value);
+					ob.ModifierSpecified = true;
+				}
+				else if (Reader.LocalName == "BaseType" && Reader.NamespaceURI == "") {
+					ob. at BaseType = Reader.Value;
+				}
+				else if (Reader.LocalName == "Provider" && Reader.NamespaceURI == "") {
+					ob. at Provider = Reader.Value;
+				}
+				else if (Reader.LocalName == "ExternalMapping" && Reader.NamespaceURI == "") {
+					ob. at ExternalMapping = XmlConvert.ToBoolean (Reader.Value);
+					ob.ExternalMappingSpecified = true;
+				}
+				else if (Reader.LocalName == "Serialization" && Reader.NamespaceURI == "") {
+					ob. at Serialization = GetEnumValue_SerializationMode (Reader.Value);
+					ob.SerializationSpecified = true;
+				}
+				else if (Reader.LocalName == "EntityBase" && Reader.NamespaceURI == "") {
+					ob. at EntityBase = Reader.Value;
+				}
+				else if (IsXmlnsAttribute (Reader.Name)) {
+				}
+				else {
+					UnknownNode (ob);
+				}
+			}
+
+			Reader.MoveToElement ();
+			Reader.MoveToElement();
+			if (Reader.IsEmptyElement) {
+				Reader.Skip ();
+				return ob;
+			}
+
+			Reader.ReadStartElement();
+			Reader.MoveToContent();
+
+			bool b0=false, b1=false, b2=false;
+
+			DbLinq.Schema.Dbml.Table[] o4;
+			o4 = null;
+			DbLinq.Schema.Dbml.Function[] o6;
+			o6 = null;
+			int n3=0, n5=0;
+
+			while (Reader.NodeType != System.Xml.XmlNodeType.EndElement) 
+			{
+				if (Reader.NodeType == System.Xml.XmlNodeType.Element) 
+				{
+					if (Reader.LocalName == "Table" && Reader.NamespaceURI == "http://schemas.microsoft.com/linqtosql/dbml/2007" && !b1) {
+						o4 = (DbLinq.Schema.Dbml.Table[]) EnsureArrayIndex (o4, n3, typeof(DbLinq.Schema.Dbml.Table));
+						o4[n3] = ReadObject_Table (false, true);
+						n3++;
+					}
+					else if (Reader.LocalName == "Function" && Reader.NamespaceURI == "http://schemas.microsoft.com/linqtosql/dbml/2007" && !b2) {
+						o6 = (DbLinq.Schema.Dbml.Function[]) EnsureArrayIndex (o6, n5, typeof(DbLinq.Schema.Dbml.Function));
+						o6[n5] = ReadObject_Function (false, true);
+						n5++;
+					}
+					else if (Reader.LocalName == "Connection" && Reader.NamespaceURI == "http://schemas.microsoft.com/linqtosql/dbml/2007" && !b0) {
+						b0 = true;
+						ob. at Connection = ReadObject_Connection (false, true);
+					}
+					else {
+						UnknownNode (ob);
+					}
+				}
+				else
+					UnknownNode(ob);
+
+				Reader.MoveToContent();
+			}
+
+			o4 = (DbLinq.Schema.Dbml.Table[]) ShrinkArray (o4, n3, typeof(DbLinq.Schema.Dbml.Table), true);
+			ob. at Table = o4;
+			o6 = (DbLinq.Schema.Dbml.Function[]) ShrinkArray (o6, n5, typeof(DbLinq.Schema.Dbml.Function), true);
+			ob. at Function = o6;
+
+			ReadEndElement();
+
+			return ob;
+		}
+
+		public DbLinq.Schema.Dbml.AccessModifier ReadObject_AccessModifier (bool isNullable, bool checkType)
+		{
+			Reader.ReadStartElement ();
+			DbLinq.Schema.Dbml.AccessModifier res = GetEnumValue_AccessModifier (Reader.ReadString());
+			if (Reader.NodeType != XmlNodeType.None)
+			Reader.ReadEndElement ();
+			return res;
+		}
+
+		DbLinq.Schema.Dbml.AccessModifier GetEnumValue_AccessModifier (string xmlName)
+		{
+			switch (xmlName)
+			{
+				case "Public": return DbLinq.Schema.Dbml.AccessModifier.Public;
+				case "Internal": return DbLinq.Schema.Dbml.AccessModifier.Internal;
+				case "Protected": return DbLinq.Schema.Dbml.AccessModifier.Protected;
+				case "ProtectedInternal": return DbLinq.Schema.Dbml.AccessModifier.ProtectedInternal;
+				case "Private": return DbLinq.Schema.Dbml.AccessModifier.Private;
+				default:
+					throw CreateUnknownConstantException (xmlName, typeof(DbLinq.Schema.Dbml.AccessModifier));
+			}
+		}
+
+		public DbLinq.Schema.Dbml.ClassModifier ReadObject_ClassModifier (bool isNullable, bool checkType)
+		{
+			Reader.ReadStartElement ();
+			DbLinq.Schema.Dbml.ClassModifier res = GetEnumValue_ClassModifier (Reader.ReadString());
+			if (Reader.NodeType != XmlNodeType.None)
+			Reader.ReadEndElement ();
+			return res;
+		}
+
+		DbLinq.Schema.Dbml.ClassModifier GetEnumValue_ClassModifier (string xmlName)
+		{
+			switch (xmlName)
+			{
+				case "Sealed": return DbLinq.Schema.Dbml.ClassModifier.Sealed;
+				case "Abstract": return DbLinq.Schema.Dbml.ClassModifier.Abstract;
+				default:
+					throw CreateUnknownConstantException (xmlName, typeof(DbLinq.Schema.Dbml.ClassModifier));
+			}
+		}
+
+		public DbLinq.Schema.Dbml.SerializationMode ReadObject_SerializationMode (bool isNullable, bool checkType)
+		{
+			Reader.ReadStartElement ();
+			DbLinq.Schema.Dbml.SerializationMode res = GetEnumValue_SerializationMode (Reader.ReadString());
+			if (Reader.NodeType != XmlNodeType.None)
+			Reader.ReadEndElement ();
+			return res;
+		}
+
+		DbLinq.Schema.Dbml.SerializationMode GetEnumValue_SerializationMode (string xmlName)
+		{
+			switch (xmlName)
+			{
+				case "None": return DbLinq.Schema.Dbml.SerializationMode.None;
+				case "Unidirectional": return DbLinq.Schema.Dbml.SerializationMode.Unidirectional;
+				default:
+					throw CreateUnknownConstantException (xmlName, typeof(DbLinq.Schema.Dbml.SerializationMode));
+			}
+		}
+
+		public DbLinq.Schema.Dbml.Table ReadObject_Table (bool isNullable, bool checkType)
+		{
+			DbLinq.Schema.Dbml.Table ob = null;
+			if (isNullable && ReadNull()) return null;
+
+			if (checkType) 
+			{
+				System.Xml.XmlQualifiedName t = GetXsiType();
+				if (t == null)
+				{ }
+				else if (t.Name != "Table" || t.Namespace != "http://schemas.microsoft.com/linqtosql/dbml/2007")
+					throw CreateUnknownTypeException(t);
+			}
+
+			ob = (DbLinq.Schema.Dbml.Table) Activator.CreateInstance(typeof(DbLinq.Schema.Dbml.Table), true);
+
+			Reader.MoveToElement();
+
+			while (Reader.MoveToNextAttribute())
+			{
+				if (Reader.LocalName == "Name" && Reader.NamespaceURI == "") {
+					ob. at Name = Reader.Value;
+				}
+				else if (Reader.LocalName == "Member" && Reader.NamespaceURI == "") {
+					ob. at Member = Reader.Value;
+				}
+				else if (Reader.LocalName == "AccessModifier" && Reader.NamespaceURI == "") {
+					ob. at AccessModifier = GetEnumValue_AccessModifier (Reader.Value);
+					ob.AccessModifierSpecified = true;
+				}
+				else if (Reader.LocalName == "Modifier" && Reader.NamespaceURI == "") {
+					ob. at Modifier = GetEnumValue_MemberModifier (Reader.Value);
+					ob.ModifierSpecified = true;
+				}
+				else if (IsXmlnsAttribute (Reader.Name)) {
+				}
+				else {
+					UnknownNode (ob);
+				}
+			}
+
+			Reader.MoveToElement ();
+			Reader.MoveToElement();
+			if (Reader.IsEmptyElement) {
+				Reader.Skip ();
+				return ob;
+			}
+
+			Reader.ReadStartElement();
+			Reader.MoveToContent();
+
+			bool b7=false, b8=false, b9=false, b10=false;
+
+			while (Reader.NodeType != System.Xml.XmlNodeType.EndElement) 
+			{
+				if (Reader.NodeType == System.Xml.XmlNodeType.Element) 
+				{
+					if (Reader.LocalName == "UpdateFunction" && Reader.NamespaceURI == "http://schemas.microsoft.com/linqtosql/dbml/2007" && !b9) {
+						b9 = true;
+						ob. at UpdateFunction = ReadObject_TableFunction (false, true);
+					}
+					else if (Reader.LocalName == "Type" && Reader.NamespaceURI == "http://schemas.microsoft.com/linqtosql/dbml/2007" && !b7) {
+						b7 = true;
+						ob. at Type = ReadObject_Type (false, true);
+					}
+					else if (Reader.LocalName == "InsertFunction" && Reader.NamespaceURI == "http://schemas.microsoft.com/linqtosql/dbml/2007" && !b8) {
+						b8 = true;
+						ob. at InsertFunction = ReadObject_TableFunction (false, true);
+					}
+					else if (Reader.LocalName == "DeleteFunction" && Reader.NamespaceURI == "http://schemas.microsoft.com/linqtosql/dbml/2007" && !b10) {
+						b10 = true;
+						ob. at DeleteFunction = ReadObject_TableFunction (false, true);
+					}
+					else {
+						UnknownNode (ob);
+					}
+				}
+				else
+					UnknownNode(ob);
+
+				Reader.MoveToContent();
+			}
+
+			ReadEndElement();
+
+			return ob;
+		}
+
+		public DbLinq.Schema.Dbml.Function ReadObject_Function (bool isNullable, bool checkType)
+		{
+			DbLinq.Schema.Dbml.Function ob = null;
+			if (isNullable && ReadNull()) return null;
+
+			if (checkType) 
+			{
+				System.Xml.XmlQualifiedName t = GetXsiType();
+				if (t == null)
+				{ }
+				else if (t.Name != "Function" || t.Namespace != "http://schemas.microsoft.com/linqtosql/dbml/2007")
+					throw CreateUnknownTypeException(t);
+			}
+
+			ob = (DbLinq.Schema.Dbml.Function) Activator.CreateInstance(typeof(DbLinq.Schema.Dbml.Function), true);
+
+			Reader.MoveToElement();
+
+			while (Reader.MoveToNextAttribute())
+			{
+				if (Reader.LocalName == "Name" && Reader.NamespaceURI == "") {
+					ob. at Name = Reader.Value;
+				}
+				else if (Reader.LocalName == "Id" && Reader.NamespaceURI == "") {
+					ob. at Id = Reader.Value;
+				}
+				else if (Reader.LocalName == "Method" && Reader.NamespaceURI == "") {
+					ob. at Method = Reader.Value;
+				}
+				else if (Reader.LocalName == "AccessModifier" && Reader.NamespaceURI == "") {
+					ob. at AccessModifier = GetEnumValue_AccessModifier (Reader.Value);
+					ob.AccessModifierSpecified = true;
+				}
+				else if (Reader.LocalName == "Modifier" && Reader.NamespaceURI == "") {
+					ob. at Modifier = GetEnumValue_MemberModifier (Reader.Value);
+					ob.ModifierSpecified = true;
+				}
+				else if (Reader.LocalName == "HasMultipleResults" && Reader.NamespaceURI == "") {
+					ob. at HasMultipleResults = XmlConvert.ToBoolean (Reader.Value);
+					ob.HasMultipleResultsSpecified = true;
+				}
+				else if (Reader.LocalName == "IsComposable" && Reader.NamespaceURI == "") {
+					ob. at IsComposable = XmlConvert.ToBoolean (Reader.Value);
+					ob.IsComposableSpecified = true;
+				}
+				else if (IsXmlnsAttribute (Reader.Name)) {
+				}
+				else {
+					UnknownNode (ob);
+				}
+			}
+
+			Reader.MoveToElement ();
+			Reader.MoveToElement();
+			if (Reader.IsEmptyElement) {
+				Reader.Skip ();
+				return ob;
+			}
+
+			Reader.ReadStartElement();
+			Reader.MoveToContent();
+
+			bool b11=false, b12=false;
+
+			DbLinq.Schema.Dbml.Parameter[] o14;
+			o14 = null;
+			System.Object[] o16;
+			o16 = null;
+			int n13=0, n15=0;
+
+			while (Reader.NodeType != System.Xml.XmlNodeType.EndElement) 
+			{
+				if (Reader.NodeType == System.Xml.XmlNodeType.Element) 
+				{
+					if (Reader.LocalName == "Return" && Reader.NamespaceURI == "http://schemas.microsoft.com/linqtosql/dbml/2007" && !b12) {
+						o16 = (System.Object[]) EnsureArrayIndex (o16, n15, typeof(System.Object));
+						o16[n15] = ReadObject_Return (false, true);
+						n15++;
+					}
+					else if (Reader.LocalName == "ElementType" && Reader.NamespaceURI == "http://schemas.microsoft.com/linqtosql/dbml/2007" && !b12) {
+						o16 = (System.Object[]) EnsureArrayIndex (o16, n15, typeof(System.Object));
+						o16[n15] = ReadObject_Type (false, true);
+						n15++;
+					}
+					else if (Reader.LocalName == "Parameter" && Reader.NamespaceURI == "http://schemas.microsoft.com/linqtosql/dbml/2007" && !b11) {
+						o14 = (DbLinq.Schema.Dbml.Parameter[]) EnsureArrayIndex (o14, n13, typeof(DbLinq.Schema.Dbml.Parameter));
+						o14[n13] = ReadObject_Parameter (false, true);
+						n13++;
+					}
+					else {
+						UnknownNode (ob);
+					}
+				}
+				else
+					UnknownNode(ob);
+
+				Reader.MoveToContent();
+			}
+
+			o14 = (DbLinq.Schema.Dbml.Parameter[]) ShrinkArray (o14, n13, typeof(DbLinq.Schema.Dbml.Parameter), true);
+			ob. at Parameter = o14;
+			o16 = (System.Object[]) ShrinkArray (o16, n15, typeof(System.Object), true);
+			ob. at Items = o16;
+
+			ReadEndElement();
+
+			return ob;
+		}
+
+		public DbLinq.Schema.Dbml.Connection ReadObject_Connection (bool isNullable, bool checkType)
+		{
+			DbLinq.Schema.Dbml.Connection ob = null;
+			if (isNullable && ReadNull()) return null;
+
+			if (checkType) 
+			{
+				System.Xml.XmlQualifiedName t = GetXsiType();
+				if (t == null)
+				{ }
+				else if (t.Name != "Connection" || t.Namespace != "http://schemas.microsoft.com/linqtosql/dbml/2007")
+					throw CreateUnknownTypeException(t);
+			}
+
+			ob = (DbLinq.Schema.Dbml.Connection) Activator.CreateInstance(typeof(DbLinq.Schema.Dbml.Connection), true);
+
+			Reader.MoveToElement();
+
+			while (Reader.MoveToNextAttribute())
+			{
+				if (Reader.LocalName == "Provider" && Reader.NamespaceURI == "") {
+					ob. at Provider = Reader.Value;
+				}
+				else if (Reader.LocalName == "Mode" && Reader.NamespaceURI == "") {
+					ob. at Mode = GetEnumValue_ConnectionMode (Reader.Value);
+					ob.ModeSpecified = true;
+				}
+				else if (Reader.LocalName == "ConnectionString" && Reader.NamespaceURI == "") {
+					ob. at ConnectionString = Reader.Value;
+				}
+				else if (Reader.LocalName == "SettingsObjectName" && Reader.NamespaceURI == "") {
+					ob. at SettingsObjectName = Reader.Value;
+				}
+				else if (Reader.LocalName == "SettingsPropertyName" && Reader.NamespaceURI == "") {
+					ob. at SettingsPropertyName = Reader.Value;
+				}
+				else if (IsXmlnsAttribute (Reader.Name)) {
+				}
+				else {
+					UnknownNode (ob);
+				}
+			}
+
+			Reader.MoveToElement ();
+			Reader.MoveToElement();
+			if (Reader.IsEmptyElement) {
+				Reader.Skip ();
+				return ob;
+			}
+
+			Reader.ReadStartElement();
+			Reader.MoveToContent();
+
+			while (Reader.NodeType != System.Xml.XmlNodeType.EndElement) 
+			{
+				if (Reader.NodeType == System.Xml.XmlNodeType.Element) 
+				{
+					UnknownNode (ob);
+				}
+				else
+					UnknownNode(ob);
+
+				Reader.MoveToContent();
+			}
+
+			ReadEndElement();
+
+			return ob;
+		}
+
+		public DbLinq.Schema.Dbml.MemberModifier ReadObject_MemberModifier (bool isNullable, bool checkType)
+		{
+			Reader.ReadStartElement ();
+			DbLinq.Schema.Dbml.MemberModifier res = GetEnumValue_MemberModifier (Reader.ReadString());
+			if (Reader.NodeType != XmlNodeType.None)
+			Reader.ReadEndElement ();
+			return res;
+		}
+
+		DbLinq.Schema.Dbml.MemberModifier GetEnumValue_MemberModifier (string xmlName)
+		{
+			switch (xmlName)
+			{
+				case "Virtual": return DbLinq.Schema.Dbml.MemberModifier.Virtual;
+				case "Override": return DbLinq.Schema.Dbml.MemberModifier.Override;
+				case "New": return DbLinq.Schema.Dbml.MemberModifier.New;
+				case "NewVirtual": return DbLinq.Schema.Dbml.MemberModifier.NewVirtual;
+				default:
+					throw CreateUnknownConstantException (xmlName, typeof(DbLinq.Schema.Dbml.MemberModifier));
+			}
+		}
+
+		public DbLinq.Schema.Dbml.TableFunction ReadObject_TableFunction (bool isNullable, bool checkType)
+		{
+			DbLinq.Schema.Dbml.TableFunction ob = null;
+			if (isNullable && ReadNull()) return null;
+
+			if (checkType) 
+			{
+				System.Xml.XmlQualifiedName t = GetXsiType();
+				if (t == null)
+				{ }
+				else if (t.Name != "TableFunction" || t.Namespace != "http://schemas.microsoft.com/linqtosql/dbml/2007")
+					throw CreateUnknownTypeException(t);
+			}
+
+			ob = (DbLinq.Schema.Dbml.TableFunction) Activator.CreateInstance(typeof(DbLinq.Schema.Dbml.TableFunction), true);
+
+			Reader.MoveToElement();
+
+			while (Reader.MoveToNextAttribute())
+			{
+				if (Reader.LocalName == "FunctionId" && Reader.NamespaceURI == "") {
+					ob. at FunctionId = Reader.Value;
+				}
+				else if (Reader.LocalName == "AccessModifier" && Reader.NamespaceURI == "") {
+					ob. at AccessModifier = GetEnumValue_AccessModifier (Reader.Value);
+					ob.AccessModifierSpecified = true;
+				}
+				else if (IsXmlnsAttribute (Reader.Name)) {
+				}
+				else {
+					UnknownNode (ob);
+				}
+			}
+
+			Reader.MoveToElement ();
+			Reader.MoveToElement();
+			if (Reader.IsEmptyElement) {
+				Reader.Skip ();
+				return ob;
+			}
+
+			Reader.ReadStartElement();
+			Reader.MoveToContent();
+
+			bool b17=false, b18=false;
+
+			DbLinq.Schema.Dbml.TableFunctionParameter[] o20;
+			o20 = null;
+			int n19=0;
+
+			while (Reader.NodeType != System.Xml.XmlNodeType.EndElement) 
+			{
+				if (Reader.NodeType == System.Xml.XmlNodeType.Element) 
+				{
+					if (Reader.LocalName == "Return" && Reader.NamespaceURI == "http://schemas.microsoft.com/linqtosql/dbml/2007" && !b18) {
+						b18 = true;
+						ob. at Return = ReadObject_TableFunctionReturn (false, true);
+					}
+					else if (Reader.LocalName == "Argument" && Reader.NamespaceURI == "http://schemas.microsoft.com/linqtosql/dbml/2007" && !b17) {
+						o20 = (DbLinq.Schema.Dbml.TableFunctionParameter[]) EnsureArrayIndex (o20, n19, typeof(DbLinq.Schema.Dbml.TableFunctionParameter));
+						o20[n19] = ReadObject_TableFunctionParameter (false, true);
+						n19++;
+					}
+					else {
+						UnknownNode (ob);
+					}
+				}
+				else
+					UnknownNode(ob);
+
+				Reader.MoveToContent();
+			}
+
+			o20 = (DbLinq.Schema.Dbml.TableFunctionParameter[]) ShrinkArray (o20, n19, typeof(DbLinq.Schema.Dbml.TableFunctionParameter), true);
+			ob. at Argument = o20;
+
+			ReadEndElement();
+
+			return ob;
+		}
+
+		public DbLinq.Schema.Dbml.Type ReadObject_Type (bool isNullable, bool checkType)
+		{
+			DbLinq.Schema.Dbml.Type ob = null;
+			if (isNullable && ReadNull()) return null;
+
+			if (checkType) 
+			{
+				System.Xml.XmlQualifiedName t = GetXsiType();
+				if (t == null)
+				{ }
+				else if (t.Name != "Type" || t.Namespace != "http://schemas.microsoft.com/linqtosql/dbml/2007")
+					throw CreateUnknownTypeException(t);
+			}
+
+			ob = (DbLinq.Schema.Dbml.Type) Activator.CreateInstance(typeof(DbLinq.Schema.Dbml.Type), true);
+
+			Reader.MoveToElement();
+
+			while (Reader.MoveToNextAttribute())
+			{
+				if (Reader.LocalName == "IdRef" && Reader.NamespaceURI == "") {
+					ob. at IdRef = Reader.Value;
+				}
+				else if (Reader.LocalName == "Id" && Reader.NamespaceURI == "") {
+					ob. at Id = Reader.Value;
+				}
+				else if (Reader.LocalName == "Name" && Reader.NamespaceURI == "") {
+					ob. at Name = Reader.Value;
+				}
+				else if (Reader.LocalName == "InheritanceCode" && Reader.NamespaceURI == "") {
+					ob. at InheritanceCode = Reader.Value;
+				}
+				else if (Reader.LocalName == "IsInheritanceDefault" && Reader.NamespaceURI == "") {
+					ob. at IsInheritanceDefault = XmlConvert.ToBoolean (Reader.Value);
+					ob.IsInheritanceDefaultSpecified = true;
+				}
+				else if (Reader.LocalName == "AccessModifier" && Reader.NamespaceURI == "") {
+					ob. at AccessModifier = GetEnumValue_AccessModifier (Reader.Value);
+					ob.AccessModifierSpecified = true;
+				}
+				else if (Reader.LocalName == "Modifier" && Reader.NamespaceURI == "") {
+					ob. at Modifier = GetEnumValue_ClassModifier (Reader.Value);
+					ob.ModifierSpecified = true;
+				}
+				else if (IsXmlnsAttribute (Reader.Name)) {
+				}
+				else {
+					UnknownNode (ob);
+				}
+			}
+
+			Reader.MoveToElement ();
+			Reader.MoveToElement();
+			if (Reader.IsEmptyElement) {
+				Reader.Skip ();
+				return ob;
+			}
+
+			Reader.ReadStartElement();
+			Reader.MoveToContent();
+
+			bool b21=false, b22=false;
+
+			System.Object[] o24;
+			o24 = null;
+			DbLinq.Schema.Dbml.Type[] o26;
+			o26 = null;
+			int n23=0, n25=0;
+
+			while (Reader.NodeType != System.Xml.XmlNodeType.EndElement) 
+			{
+				if (Reader.NodeType == System.Xml.XmlNodeType.Element) 
+				{
+					if (Reader.LocalName == "Column" && Reader.NamespaceURI == "http://schemas.microsoft.com/linqtosql/dbml/2007" && !b21) {
+						o24 = (System.Object[]) EnsureArrayIndex (o24, n23, typeof(System.Object));
+						o24[n23] = ReadObject_Column (false, true);
+						n23++;
+					}
+					else if (Reader.LocalName == "Association" && Reader.NamespaceURI == "http://schemas.microsoft.com/linqtosql/dbml/2007" && !b21) {
+						o24 = (System.Object[]) EnsureArrayIndex (o24, n23, typeof(System.Object));
+						o24[n23] = ReadObject_Association (false, true);
+						n23++;
+					}
+					else if (Reader.LocalName == "Type" && Reader.NamespaceURI == "http://schemas.microsoft.com/linqtosql/dbml/2007" && !b22) {
+						o26 = (DbLinq.Schema.Dbml.Type[]) EnsureArrayIndex (o26, n25, typeof(DbLinq.Schema.Dbml.Type));
+						o26[n25] = ReadObject_Type (false, true);
+						n25++;
+					}
+					else {
+						UnknownNode (ob);
+					}
+				}
+				else
+					UnknownNode(ob);
+
+				Reader.MoveToContent();
+			}
+
+			o24 = (System.Object[]) ShrinkArray (o24, n23, typeof(System.Object), true);
+			ob. at Items = o24;
+			o26 = (DbLinq.Schema.Dbml.Type[]) ShrinkArray (o26, n25, typeof(DbLinq.Schema.Dbml.Type), true);
+			ob. at Type1 = o26;
+
+			ReadEndElement();
+
+			return ob;
+		}
+
+		public DbLinq.Schema.Dbml.Return ReadObject_Return (bool isNullable, bool checkType)
+		{
+			DbLinq.Schema.Dbml.Return ob = null;
+			if (isNullable && ReadNull()) return null;
+
+			if (checkType) 
+			{
+				System.Xml.XmlQualifiedName t = GetXsiType();
+				if (t == null)
+				{ }
+				else if (t.Name != "Return" || t.Namespace != "http://schemas.microsoft.com/linqtosql/dbml/2007")
+					throw CreateUnknownTypeException(t);
+			}
+
+			ob = (DbLinq.Schema.Dbml.Return) Activator.CreateInstance(typeof(DbLinq.Schema.Dbml.Return), true);
+
+			Reader.MoveToElement();
+
+			while (Reader.MoveToNextAttribute())
+			{
+				if (Reader.LocalName == "Type" && Reader.NamespaceURI == "") {
+					ob. at Type = Reader.Value;
+				}
+				else if (Reader.LocalName == "DbType" && Reader.NamespaceURI == "") {
+					ob. at DbType = Reader.Value;
+				}
+				else if (IsXmlnsAttribute (Reader.Name)) {
+				}
+				else {
+					UnknownNode (ob);
+				}
+			}
+
+			Reader.MoveToElement ();
+			Reader.MoveToElement();
+			if (Reader.IsEmptyElement) {
+				Reader.Skip ();
+				return ob;
+			}
+
+			Reader.ReadStartElement();
+			Reader.MoveToContent();
+
+			while (Reader.NodeType != System.Xml.XmlNodeType.EndElement) 
+			{
+				if (Reader.NodeType == System.Xml.XmlNodeType.Element) 
+				{
+					UnknownNode (ob);
+				}
+				else
+					UnknownNode(ob);
+
+				Reader.MoveToContent();
+			}
+
+			ReadEndElement();
+
+			return ob;
+		}
+
+		public DbLinq.Schema.Dbml.Parameter ReadObject_Parameter (bool isNullable, bool checkType)
+		{
+			DbLinq.Schema.Dbml.Parameter ob = null;
+			if (isNullable && ReadNull()) return null;
+
+			if (checkType) 
+			{
+				System.Xml.XmlQualifiedName t = GetXsiType();
+				if (t == null)
+				{ }
+				else if (t.Name != "Parameter" || t.Namespace != "http://schemas.microsoft.com/linqtosql/dbml/2007")
+					throw CreateUnknownTypeException(t);
+			}
+
+			ob = (DbLinq.Schema.Dbml.Parameter) Activator.CreateInstance(typeof(DbLinq.Schema.Dbml.Parameter), true);
+
+			Reader.MoveToElement();
+
+			while (Reader.MoveToNextAttribute())
+			{
+				if (Reader.LocalName == "Name" && Reader.NamespaceURI == "") {
+					ob. at Name = Reader.Value;
+				}
+				else if (Reader.LocalName == "Parameter" && Reader.NamespaceURI == "") {
+					ob. at Parameter1 = Reader.Value;
+				}
+				else if (Reader.LocalName == "Type" && Reader.NamespaceURI == "") {
+					ob. at Type = Reader.Value;
+				}
+				else if (Reader.LocalName == "DbType" && Reader.NamespaceURI == "") {
+					ob. at DbType = Reader.Value;
+				}
+				else if (Reader.LocalName == "Direction" && Reader.NamespaceURI == "") {
+					ob. at Direction = GetEnumValue_ParameterDirection (Reader.Value);
+					ob.DirectionSpecified = true;
+				}
+				else if (IsXmlnsAttribute (Reader.Name)) {
+				}
+				else {
+					UnknownNode (ob);
+				}
+			}
+
+			Reader.MoveToElement ();
+			Reader.MoveToElement();
+			if (Reader.IsEmptyElement) {
+				Reader.Skip ();
+				return ob;
+			}
+
+			Reader.ReadStartElement();
+			Reader.MoveToContent();
+
+			while (Reader.NodeType != System.Xml.XmlNodeType.EndElement) 
+			{
+				if (Reader.NodeType == System.Xml.XmlNodeType.Element) 
+				{
+					UnknownNode (ob);
+				}
+				else
+					UnknownNode(ob);
+
+				Reader.MoveToContent();
+			}
+
+			ReadEndElement();
+
+			return ob;
+		}
+
+		public DbLinq.Schema.Dbml.ConnectionMode ReadObject_ConnectionMode (bool isNullable, bool checkType)
+		{
+			Reader.ReadStartElement ();
+			DbLinq.Schema.Dbml.ConnectionMode res = GetEnumValue_ConnectionMode (Reader.ReadString());
+			if (Reader.NodeType != XmlNodeType.None)
+			Reader.ReadEndElement ();
+			return res;
+		}
+
+		DbLinq.Schema.Dbml.ConnectionMode GetEnumValue_ConnectionMode (string xmlName)
+		{
+			switch (xmlName)
+			{
+				case "ConnectionString": return DbLinq.Schema.Dbml.ConnectionMode.ConnectionString;
+				case "AppSettings": return DbLinq.Schema.Dbml.ConnectionMode.AppSettings;
+				case "WebSettings": return DbLinq.Schema.Dbml.ConnectionMode.WebSettings;
+				default:
+					throw CreateUnknownConstantException (xmlName, typeof(DbLinq.Schema.Dbml.ConnectionMode));
+			}
+		}
+
+		public DbLinq.Schema.Dbml.TableFunctionReturn ReadObject_TableFunctionReturn (bool isNullable, bool checkType)
+		{
+			DbLinq.Schema.Dbml.TableFunctionReturn ob = null;
+			if (isNullable && ReadNull()) return null;
+
+			if (checkType) 
+			{
+				System.Xml.XmlQualifiedName t = GetXsiType();
+				if (t == null)
+				{ }
+				else if (t.Name != "TableFunctionReturn" || t.Namespace != "http://schemas.microsoft.com/linqtosql/dbml/2007")
+					throw CreateUnknownTypeException(t);
+			}
+
+			ob = (DbLinq.Schema.Dbml.TableFunctionReturn) Activator.CreateInstance(typeof(DbLinq.Schema.Dbml.TableFunctionReturn), true);
+
+			Reader.MoveToElement();
+
+			while (Reader.MoveToNextAttribute())
+			{
+				if (Reader.LocalName == "Member" && Reader.NamespaceURI == "") {
+					ob. at Member = Reader.Value;
+				}
+				else if (IsXmlnsAttribute (Reader.Name)) {
+				}
+				else {
+					UnknownNode (ob);
+				}
+			}
+
+			Reader.MoveToElement ();
+			Reader.MoveToElement();
+			if (Reader.IsEmptyElement) {
+				Reader.Skip ();
+				return ob;
+			}
+
+			Reader.ReadStartElement();
+			Reader.MoveToContent();
+
+			while (Reader.NodeType != System.Xml.XmlNodeType.EndElement) 
+			{
+				if (Reader.NodeType == System.Xml.XmlNodeType.Element) 
+				{
+					UnknownNode (ob);
+				}
+				else
+					UnknownNode(ob);
+
+				Reader.MoveToContent();
+			}
+
+			ReadEndElement();
+
+			return ob;
+		}
+
+		public DbLinq.Schema.Dbml.TableFunctionParameter ReadObject_TableFunctionParameter (bool isNullable, bool checkType)
+		{
+			DbLinq.Schema.Dbml.TableFunctionParameter ob = null;
+			if (isNullable && ReadNull()) return null;
+
+			if (checkType) 
+			{
+				System.Xml.XmlQualifiedName t = GetXsiType();
+				if (t == null)
+				{ }
+				else if (t.Name != "TableFunctionParameter" || t.Namespace != "http://schemas.microsoft.com/linqtosql/dbml/2007")
+					throw CreateUnknownTypeException(t);
+			}
+
+			ob = (DbLinq.Schema.Dbml.TableFunctionParameter) Activator.CreateInstance(typeof(DbLinq.Schema.Dbml.TableFunctionParameter), true);
+
+			Reader.MoveToElement();
+
+			while (Reader.MoveToNextAttribute())
+			{
+				if (Reader.LocalName == "Parameter" && Reader.NamespaceURI == "") {
+					ob. at Parameter = Reader.Value;
+				}
+				else if (Reader.LocalName == "Member" && Reader.NamespaceURI == "") {
+					ob. at Member = Reader.Value;
+				}
+				else if (Reader.LocalName == "Version" && Reader.NamespaceURI == "") {
+					ob. at Version = GetEnumValue_Version (Reader.Value);
+					ob.VersionSpecified = true;
+				}
+				else if (IsXmlnsAttribute (Reader.Name)) {
+				}
+				else {
+					UnknownNode (ob);
+				}
+			}
+
+			Reader.MoveToElement ();
+			Reader.MoveToElement();
+			if (Reader.IsEmptyElement) {
+				Reader.Skip ();
+				return ob;
+			}
+
+			Reader.ReadStartElement();
+			Reader.MoveToContent();
+
+			while (Reader.NodeType != System.Xml.XmlNodeType.EndElement) 
+			{
+				if (Reader.NodeType == System.Xml.XmlNodeType.Element) 
+				{
+					UnknownNode (ob);
+				}
+				else
+					UnknownNode(ob);
+
+				Reader.MoveToContent();
+			}
+
+			ReadEndElement();
+
+			return ob;
+		}
+
+		public DbLinq.Schema.Dbml.Column ReadObject_Column (bool isNullable, bool checkType)
+		{
+			DbLinq.Schema.Dbml.Column ob = null;
+			if (isNullable && ReadNull()) return null;
+
+			if (checkType) 
+			{
+				System.Xml.XmlQualifiedName t = GetXsiType();
+				if (t == null)
+				{ }
+				else if (t.Name != "Column" || t.Namespace != "http://schemas.microsoft.com/linqtosql/dbml/2007")
+					throw CreateUnknownTypeException(t);
+			}
+
+			ob = (DbLinq.Schema.Dbml.Column) Activator.CreateInstance(typeof(DbLinq.Schema.Dbml.Column), true);
+
+			Reader.MoveToElement();
+
+			while (Reader.MoveToNextAttribute())
+			{
+				if (Reader.LocalName == "Name" && Reader.NamespaceURI == "") {
+					ob. at Name = Reader.Value;
+				}
+				else if (Reader.LocalName == "Member" && Reader.NamespaceURI == "") {
+					ob. at Member = Reader.Value;
+				}
+				else if (Reader.LocalName == "Storage" && Reader.NamespaceURI == "") {
+					ob. at Storage = Reader.Value;
+				}
+				else if (Reader.LocalName == "AccessModifier" && Reader.NamespaceURI == "") {
+					ob. at AccessModifier = GetEnumValue_AccessModifier (Reader.Value);
+					ob.AccessModifierSpecified = true;
+				}
+				else if (Reader.LocalName == "Modifier" && Reader.NamespaceURI == "") {
+					ob. at Modifier = GetEnumValue_MemberModifier (Reader.Value);
+					ob.ModifierSpecified = true;
+				}
+				else if (Reader.LocalName == "Type" && Reader.NamespaceURI == "") {
+					ob. at Type = Reader.Value;
+				}
+				else if (Reader.LocalName == "DbType" && Reader.NamespaceURI == "") {
+					ob. at DbType = Reader.Value;
+				}
+				else if (Reader.LocalName == "IsReadOnly" && Reader.NamespaceURI == "") {
+					ob. at IsReadOnly = XmlConvert.ToBoolean (Reader.Value);
+					ob.IsReadOnlySpecified = true;
+				}
+				else if (Reader.LocalName == "IsPrimaryKey" && Reader.NamespaceURI == "") {
+					ob. at IsPrimaryKey = XmlConvert.ToBoolean (Reader.Value);
+					ob.IsPrimaryKeySpecified = true;
+				}
+				else if (Reader.LocalName == "IsDbGenerated" && Reader.NamespaceURI == "") {
+					ob. at IsDbGenerated = XmlConvert.ToBoolean (Reader.Value);
+					ob.IsDbGeneratedSpecified = true;
+				}
+				else if (Reader.LocalName == "CanBeNull" && Reader.NamespaceURI == "") {
+					ob. at CanBeNull = XmlConvert.ToBoolean (Reader.Value);
+					ob.CanBeNullSpecified = true;
+				}
+				else if (Reader.LocalName == "UpdateCheck" && Reader.NamespaceURI == "") {
+					ob. at UpdateCheck = GetEnumValue_UpdateCheck (Reader.Value);
+					ob.UpdateCheckSpecified = true;
+				}
+				else if (Reader.LocalName == "IsDiscriminator" && Reader.NamespaceURI == "") {
+					ob. at IsDiscriminator = XmlConvert.ToBoolean (Reader.Value);
+					ob.IsDiscriminatorSpecified = true;
+				}
+				else if (Reader.LocalName == "Expression" && Reader.NamespaceURI == "") {
+					ob. at Expression = Reader.Value;
+				}
+				else if (Reader.LocalName == "IsVersion" && Reader.NamespaceURI == "") {
+					ob. at IsVersion = XmlConvert.ToBoolean (Reader.Value);
+					ob.IsVersionSpecified = true;
+				}
+				else if (Reader.LocalName == "IsDelayLoaded" && Reader.NamespaceURI == "") {
+					ob. at IsDelayLoaded = XmlConvert.ToBoolean (Reader.Value);
+					ob.IsDelayLoadedSpecified = true;
+				}
+				else if (Reader.LocalName == "AutoSync" && Reader.NamespaceURI == "") {
+					ob. at AutoSync = GetEnumValue_AutoSync (Reader.Value);
+					ob.AutoSyncSpecified = true;
+				}
+				else if (IsXmlnsAttribute (Reader.Name)) {
+				}
+				else {
+					UnknownNode (ob);
+				}
+			}
+
+			Reader.MoveToElement ();
+			Reader.MoveToElement();
+			if (Reader.IsEmptyElement) {
+				Reader.Skip ();
+				return ob;
+			}
+
+			Reader.ReadStartElement();
+			Reader.MoveToContent();
+
+			while (Reader.NodeType != System.Xml.XmlNodeType.EndElement) 
+			{
+				if (Reader.NodeType == System.Xml.XmlNodeType.Element) 
+				{
+					UnknownNode (ob);
+				}
+				else
+					UnknownNode(ob);
+
+				Reader.MoveToContent();
+			}
+
+			ReadEndElement();
+
+			return ob;
+		}
+
+		public DbLinq.Schema.Dbml.Association ReadObject_Association (bool isNullable, bool checkType)
+		{
+			DbLinq.Schema.Dbml.Association ob = null;
+			if (isNullable && ReadNull()) return null;
+
+			if (checkType) 
+			{
+				System.Xml.XmlQualifiedName t = GetXsiType();
+				if (t == null)
+				{ }
+				else if (t.Name != "Association" || t.Namespace != "http://schemas.microsoft.com/linqtosql/dbml/2007")
+					throw CreateUnknownTypeException(t);
+			}
+
+			ob = (DbLinq.Schema.Dbml.Association) Activator.CreateInstance(typeof(DbLinq.Schema.Dbml.Association), true);
+
+			Reader.MoveToElement();
+
+			while (Reader.MoveToNextAttribute())
+			{
+				if (Reader.LocalName == "Name" && Reader.NamespaceURI == "") {
+					ob. at Name = Reader.Value;
+				}
+				else if (Reader.LocalName == "Member" && Reader.NamespaceURI == "") {
+					ob. at Member = Reader.Value;
+				}
+				else if (Reader.LocalName == "Storage" && Reader.NamespaceURI == "") {
+					ob. at Storage = Reader.Value;
+				}
+				else if (Reader.LocalName == "AccessModifier" && Reader.NamespaceURI == "") {
+					ob. at AccessModifier = GetEnumValue_AccessModifier (Reader.Value);
+					ob.AccessModifierSpecified = true;
+				}
+				else if (Reader.LocalName == "Modifier" && Reader.NamespaceURI == "") {
+					ob. at Modifier = GetEnumValue_MemberModifier (Reader.Value);
+					ob.ModifierSpecified = true;
+				}
+				else if (Reader.LocalName == "Type" && Reader.NamespaceURI == "") {
+					ob. at Type = Reader.Value;
+				}
+				else if (Reader.LocalName == "ThisKey" && Reader.NamespaceURI == "") {
+					ob. at ThisKey = Reader.Value;
+				}
+				else if (Reader.LocalName == "OtherKey" && Reader.NamespaceURI == "") {
+					ob. at OtherKey = Reader.Value;
+				}
+				else if (Reader.LocalName == "IsForeignKey" && Reader.NamespaceURI == "") {
+					ob. at IsForeignKey = XmlConvert.ToBoolean (Reader.Value);
+					ob.IsForeignKeySpecified = true;
+				}
+				else if (Reader.LocalName == "Cardinality" && Reader.NamespaceURI == "") {
+					ob. at Cardinality = GetEnumValue_Cardinality (Reader.Value);
+					ob.CardinalitySpecified = true;
+				}
+				else if (Reader.LocalName == "DeleteRule" && Reader.NamespaceURI == "") {
+					ob. at DeleteRule = Reader.Value;
+				}
+				else if (Reader.LocalName == "DeleteOnNull" && Reader.NamespaceURI == "") {
+					ob. at DeleteOnNull = XmlConvert.ToBoolean (Reader.Value);
+					ob.DeleteOnNullSpecified = true;
+				}
+				else if (IsXmlnsAttribute (Reader.Name)) {
+				}
+				else {
+					UnknownNode (ob);
+				}
+			}
+
+			Reader.MoveToElement ();
+			Reader.MoveToElement();
+			if (Reader.IsEmptyElement) {
+				Reader.Skip ();
+				return ob;
+			}
+
+			Reader.ReadStartElement();
+			Reader.MoveToContent();
+
+			while (Reader.NodeType != System.Xml.XmlNodeType.EndElement) 
+			{
+				if (Reader.NodeType == System.Xml.XmlNodeType.Element) 
+				{
+					UnknownNode (ob);
+				}
+				else
+					UnknownNode(ob);
+
+				Reader.MoveToContent();
+			}
+
+			ReadEndElement();
+
+			return ob;
+		}
+
+		public DbLinq.Schema.Dbml.ParameterDirection ReadObject_ParameterDirection (bool isNullable, bool checkType)
+		{
+			Reader.ReadStartElement ();
+			DbLinq.Schema.Dbml.ParameterDirection res = GetEnumValue_ParameterDirection (Reader.ReadString());
+			if (Reader.NodeType != XmlNodeType.None)
+			Reader.ReadEndElement ();
+			return res;
+		}
+
+		DbLinq.Schema.Dbml.ParameterDirection GetEnumValue_ParameterDirection (string xmlName)
+		{
+			switch (xmlName)
+			{
+				case "In": return DbLinq.Schema.Dbml.ParameterDirection.In;
+				case "Out": return DbLinq.Schema.Dbml.ParameterDirection.Out;
+				case "InOut": return DbLinq.Schema.Dbml.ParameterDirection.InOut;
+				default:
+					throw CreateUnknownConstantException (xmlName, typeof(DbLinq.Schema.Dbml.ParameterDirection));
+			}
+		}
+
+		public DbLinq.Schema.Dbml.Version ReadObject_Version (bool isNullable, bool checkType)
+		{
+			Reader.ReadStartElement ();
+			DbLinq.Schema.Dbml.Version res = GetEnumValue_Version (Reader.ReadString());
+			if (Reader.NodeType != XmlNodeType.None)
+			Reader.ReadEndElement ();
+			return res;
+		}
+
+		DbLinq.Schema.Dbml.Version GetEnumValue_Version (string xmlName)
+		{
+			switch (xmlName)
+			{
+				case "Current": return DbLinq.Schema.Dbml.Version.Current;
+				case "Original": return DbLinq.Schema.Dbml.Version.Original;
+				default:
+					throw CreateUnknownConstantException (xmlName, typeof(DbLinq.Schema.Dbml.Version));
+			}
+		}
+
+		public DbLinq.Schema.Dbml.UpdateCheck ReadObject_UpdateCheck (bool isNullable, bool checkType)
+		{
+			Reader.ReadStartElement ();
+			DbLinq.Schema.Dbml.UpdateCheck res = GetEnumValue_UpdateCheck (Reader.ReadString());
+			if (Reader.NodeType != XmlNodeType.None)
+			Reader.ReadEndElement ();
+			return res;
+		}
+
+		DbLinq.Schema.Dbml.UpdateCheck GetEnumValue_UpdateCheck (string xmlName)
+		{
+			switch (xmlName)
+			{
+				case "Always": return DbLinq.Schema.Dbml.UpdateCheck.Always;
+				case "Never": return DbLinq.Schema.Dbml.UpdateCheck.Never;
+				case "WhenChanged": return DbLinq.Schema.Dbml.UpdateCheck.WhenChanged;
+				default:
+					throw CreateUnknownConstantException (xmlName, typeof(DbLinq.Schema.Dbml.UpdateCheck));
+			}
+		}
+
+		public DbLinq.Schema.Dbml.AutoSync ReadObject_AutoSync (bool isNullable, bool checkType)
+		{
+			Reader.ReadStartElement ();
+			DbLinq.Schema.Dbml.AutoSync res = GetEnumValue_AutoSync (Reader.ReadString());
+			if (Reader.NodeType != XmlNodeType.None)
+			Reader.ReadEndElement ();
+			return res;
+		}
+
+		DbLinq.Schema.Dbml.AutoSync GetEnumValue_AutoSync (string xmlName)
+		{
+			switch (xmlName)
+			{
+				case "Never": return DbLinq.Schema.Dbml.AutoSync.Never;
+				case "OnInsert": return DbLinq.Schema.Dbml.AutoSync.OnInsert;
+				case "OnUpdate": return DbLinq.Schema.Dbml.AutoSync.OnUpdate;
+				case "Always": return DbLinq.Schema.Dbml.AutoSync.Always;
+				case "Default": return DbLinq.Schema.Dbml.AutoSync.Default;
+				default:
+					throw CreateUnknownConstantException (xmlName, typeof(DbLinq.Schema.Dbml.AutoSync));
+			}
+		}
+
+		public DbLinq.Schema.Dbml.Cardinality ReadObject_Cardinality (bool isNullable, bool checkType)
+		{
+			Reader.ReadStartElement ();
+			DbLinq.Schema.Dbml.Cardinality res = GetEnumValue_Cardinality (Reader.ReadString());
+			if (Reader.NodeType != XmlNodeType.None)
+			Reader.ReadEndElement ();
+			return res;
+		}
+
+		DbLinq.Schema.Dbml.Cardinality GetEnumValue_Cardinality (string xmlName)
+		{
+			switch (xmlName)
+			{
+				case "One": return DbLinq.Schema.Dbml.Cardinality.One;
+				case "Many": return DbLinq.Schema.Dbml.Cardinality.Many;
+				default:
+					throw CreateUnknownConstantException (xmlName, typeof(DbLinq.Schema.Dbml.Cardinality));
+			}
+		}
+
+		protected override void InitCallbacks ()
+		{
+		}
+
+		protected override void InitIDs ()
+		{
+		}
+
+	}
+
+	#if !MONO_STRICT
+    public
+    #endif
+	class GeneratedWriter : XmlSerializationWriter
+	{
+		const string xmlNamespace = "http://www.w3.org/2000/xmlns/";
+		static readonly System.Reflection.MethodInfo toBinHexStringMethod = typeof (XmlConvert).GetMethod ("ToBinHexString", System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.NonPublic, null, new System.Type [] {typeof (byte [])}, null);
+		static string ToBinHexString (byte [] input)
+		{
+			return input == null ? null : (string) toBinHexStringMethod.Invoke (null, new object [] {input});
+		}
+		public void WriteRoot_Database (object o)
+		{
+			WriteStartDocument ();
+			DbLinq.Schema.Dbml.Database ob = (DbLinq.Schema.Dbml.Database) o;
+			TopLevelElement ();
+			WriteObject_Database (ob, "Database", "http://schemas.microsoft.com/linqtosql/dbml/2007", true, false, true);
+		}
+
+		void WriteObject_Database (DbLinq.Schema.Dbml.Database ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
+		{
+			if (((object)ob) == null)
+			{
+				if (isNullable)
+					WriteNullTagLiteral(element, namesp);
+				return;
+			}
+
+			System.Type type = ob.GetType ();
+			if (type == typeof(DbLinq.Schema.Dbml.Database))
+			{ }
+			else {
+				throw CreateUnknownTypeException (ob);
+			}
+
+			if (writeWrappingElem) {
+				WriteStartElement (element, namesp, ob);
+			}
+
+			if (needType) WriteXsiType("Database", "http://schemas.microsoft.com/linqtosql/dbml/2007");
+
+			WriteAttribute ("Name", "", ob. at Name);
+			WriteAttribute ("EntityNamespace", "", ob. at EntityNamespace);
+			WriteAttribute ("ContextNamespace", "", ob. at ContextNamespace);
+			WriteAttribute ("Class", "", ob. at Class);
+			if (ob. at AccessModifierSpecified) {
+				WriteAttribute ("AccessModifier", "", GetEnumValue_AccessModifier (ob. at AccessModifier));
+			}
+			if (ob. at ModifierSpecified) {
+				WriteAttribute ("Modifier", "", GetEnumValue_ClassModifier (ob. at Modifier));
+			}
+			WriteAttribute ("BaseType", "", ob. at BaseType);
+			WriteAttribute ("Provider", "", ob. at Provider);
+			if (ob. at ExternalMappingSpecified) {
+				WriteAttribute ("ExternalMapping", "", (ob. at ExternalMapping?"true":"false"));
+			}
+			if (ob. at SerializationSpecified) {
+				WriteAttribute ("Serialization", "", GetEnumValue_SerializationMode (ob. at Serialization));
+			}
+			WriteAttribute ("EntityBase", "", ob. at EntityBase);
+
+			WriteObject_Connection (ob. at Connection, "Connection", "http://schemas.microsoft.com/linqtosql/dbml/2007", false, false, true);
+			if (ob. at Table != null) {
+				for (int n27 = 0; n27 < ob. at Table.Length; n27++) {
+					WriteObject_Table (ob. at Table[n27], "Table", "http://schemas.microsoft.com/linqtosql/dbml/2007", false, false, true);
+				}
+			}
+			if (ob. at Function != null) {
+				for (int n28 = 0; n28 < ob. at Function.Length; n28++) {
+					WriteObject_Function (ob. at Function[n28], "Function", "http://schemas.microsoft.com/linqtosql/dbml/2007", false, false, true);
+				}
+			}
+			if (writeWrappingElem) WriteEndElement (ob);
+		}
+
+		void WriteObject_AccessModifier (DbLinq.Schema.Dbml.AccessModifier ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
+		{
+			System.Type type = ob.GetType ();
+			if (type == typeof(DbLinq.Schema.Dbml.AccessModifier))
+			{ }
+			else {
+				throw CreateUnknownTypeException (ob);
+			}
+
+			if (writeWrappingElem) {
+				WriteStartElement (element, namesp, ob);
+			}
+
+			if (needType) WriteXsiType("AccessModifier", "http://schemas.microsoft.com/linqtosql/dbml/2007");
+
+			Writer.WriteString (GetEnumValue_AccessModifier (ob));
+			if (writeWrappingElem) WriteEndElement (ob);
+		}
+
+		string GetEnumValue_AccessModifier (DbLinq.Schema.Dbml.AccessModifier val)
+		{
+			switch (val) {
+				case DbLinq.Schema.Dbml.AccessModifier.Public: return "Public";
+				case DbLinq.Schema.Dbml.AccessModifier.Internal: return "Internal";
+				case DbLinq.Schema.Dbml.AccessModifier.Protected: return "Protected";
+				case DbLinq.Schema.Dbml.AccessModifier.ProtectedInternal: return "ProtectedInternal";
+				case DbLinq.Schema.Dbml.AccessModifier.Private: return "Private";
+				default: throw CreateInvalidEnumValueException ((long) val, typeof (DbLinq.Schema.Dbml.AccessModifier).FullName);
+			}
+		}
+
+		void WriteObject_ClassModifier (DbLinq.Schema.Dbml.ClassModifier ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
+		{
+			System.Type type = ob.GetType ();
+			if (type == typeof(DbLinq.Schema.Dbml.ClassModifier))
+			{ }
+			else {
+				throw CreateUnknownTypeException (ob);
+			}
+
+			if (writeWrappingElem) {
+				WriteStartElement (element, namesp, ob);
+			}
+
+			if (needType) WriteXsiType("ClassModifier", "http://schemas.microsoft.com/linqtosql/dbml/2007");
+
+			Writer.WriteString (GetEnumValue_ClassModifier (ob));
+			if (writeWrappingElem) WriteEndElement (ob);
+		}
+
+		string GetEnumValue_ClassModifier (DbLinq.Schema.Dbml.ClassModifier val)
+		{
+			switch (val) {
+				case DbLinq.Schema.Dbml.ClassModifier.Sealed: return "Sealed";
+				case DbLinq.Schema.Dbml.ClassModifier.Abstract: return "Abstract";
+				default: throw CreateInvalidEnumValueException ((long) val, typeof (DbLinq.Schema.Dbml.ClassModifier).FullName);
+			}
+		}
+
+		void WriteObject_SerializationMode (DbLinq.Schema.Dbml.SerializationMode ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
+		{
+			System.Type type = ob.GetType ();
+			if (type == typeof(DbLinq.Schema.Dbml.SerializationMode))
+			{ }
+			else {
+				throw CreateUnknownTypeException (ob);
+			}
+
+			if (writeWrappingElem) {
+				WriteStartElement (element, namesp, ob);
+			}
+
+			if (needType) WriteXsiType("SerializationMode", "http://schemas.microsoft.com/linqtosql/dbml/2007");
+
+			Writer.WriteString (GetEnumValue_SerializationMode (ob));
+			if (writeWrappingElem) WriteEndElement (ob);
+		}
+
+		string GetEnumValue_SerializationMode (DbLinq.Schema.Dbml.SerializationMode val)
+		{
+			switch (val) {
+				case DbLinq.Schema.Dbml.SerializationMode.None: return "None";
+				case DbLinq.Schema.Dbml.SerializationMode.Unidirectional: return "Unidirectional";
+				default: throw CreateInvalidEnumValueException ((long) val, typeof (DbLinq.Schema.Dbml.SerializationMode).FullName);
+			}
+		}
+
+		void WriteObject_Connection (DbLinq.Schema.Dbml.Connection ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
+		{
+			if (((object)ob) == null)
+			{
+				if (isNullable)
+					WriteNullTagLiteral(element, namesp);
+				return;
+			}
+
+			System.Type type = ob.GetType ();
+			if (type == typeof(DbLinq.Schema.Dbml.Connection))
+			{ }
+			else {
+				throw CreateUnknownTypeException (ob);
+			}
+
+			if (writeWrappingElem) {
+				WriteStartElement (element, namesp, ob);
+			}
+
+			if (needType) WriteXsiType("Connection", "http://schemas.microsoft.com/linqtosql/dbml/2007");
+
+			WriteAttribute ("Provider", "", ob. at Provider);
+			if (ob. at ModeSpecified) {
+				WriteAttribute ("Mode", "", GetEnumValue_ConnectionMode (ob. at Mode));
+			}
+			WriteAttribute ("ConnectionString", "", ob. at ConnectionString);
+			WriteAttribute ("SettingsObjectName", "", ob. at SettingsObjectName);
+			WriteAttribute ("SettingsPropertyName", "", ob. at SettingsPropertyName);
+
+			if (writeWrappingElem) WriteEndElement (ob);
+		}
+
+		void WriteObject_Table (DbLinq.Schema.Dbml.Table ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
+		{
+			if (((object)ob) == null)
+			{
+				if (isNullable)
+					WriteNullTagLiteral(element, namesp);
+				return;
+			}
+
+			System.Type type = ob.GetType ();
+			if (type == typeof(DbLinq.Schema.Dbml.Table))
+			{ }
+			else {
+				throw CreateUnknownTypeException (ob);
+			}
+
+			if (writeWrappingElem) {
+				WriteStartElement (element, namesp, ob);
+			}
+
+			if (needType) WriteXsiType("Table", "http://schemas.microsoft.com/linqtosql/dbml/2007");
+
+			WriteAttribute ("Name", "", ob. at Name);
+			WriteAttribute ("Member", "", ob. at Member);
+			if (ob. at AccessModifierSpecified) {
+				WriteAttribute ("AccessModifier", "", GetEnumValue_AccessModifier (ob. at AccessModifier));
+			}
+			if (ob. at ModifierSpecified) {
+				WriteAttribute ("Modifier", "", GetEnumValue_MemberModifier (ob. at Modifier));
+			}
+
+			WriteObject_Type (ob. at Type, "Type", "http://schemas.microsoft.com/linqtosql/dbml/2007", false, false, true);
+			WriteObject_TableFunction (ob. at InsertFunction, "InsertFunction", "http://schemas.microsoft.com/linqtosql/dbml/2007", false, false, true);
+			WriteObject_TableFunction (ob. at UpdateFunction, "UpdateFunction", "http://schemas.microsoft.com/linqtosql/dbml/2007", false, false, true);
+			WriteObject_TableFunction (ob. at DeleteFunction, "DeleteFunction", "http://schemas.microsoft.com/linqtosql/dbml/2007", false, false, true);
+			if (writeWrappingElem) WriteEndElement (ob);
+		}
+
+		void WriteObject_Function (DbLinq.Schema.Dbml.Function ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
+		{
+			if (((object)ob) == null)
+			{
+				if (isNullable)
+					WriteNullTagLiteral(element, namesp);
+				return;
+			}
+
+			System.Type type = ob.GetType ();
+			if (type == typeof(DbLinq.Schema.Dbml.Function))
+			{ }
+			else {
+				throw CreateUnknownTypeException (ob);
+			}
+
+			if (writeWrappingElem) {
+				WriteStartElement (element, namesp, ob);
+			}
+
+			if (needType) WriteXsiType("Function", "http://schemas.microsoft.com/linqtosql/dbml/2007");
+
+			WriteAttribute ("Name", "", ob. at Name);
+			WriteAttribute ("Id", "", ob. at Id);
+			WriteAttribute ("Method", "", ob. at Method);
+			if (ob. at AccessModifierSpecified) {
+				WriteAttribute ("AccessModifier", "", GetEnumValue_AccessModifier (ob. at AccessModifier));
+			}
+			if (ob. at ModifierSpecified) {
+				WriteAttribute ("Modifier", "", GetEnumValue_MemberModifier (ob. at Modifier));
+			}
+			if (ob. at HasMultipleResultsSpecified) {
+				WriteAttribute ("HasMultipleResults", "", (ob. at HasMultipleResults?"true":"false"));
+			}
+			if (ob. at IsComposableSpecified) {
+				WriteAttribute ("IsComposable", "", (ob. at IsComposable?"true":"false"));
+			}
+
+			if (ob. at Parameter != null) {
+				for (int n29 = 0; n29 < ob. at Parameter.Length; n29++) {
+					WriteObject_Parameter (ob. at Parameter[n29], "Parameter", "http://schemas.microsoft.com/linqtosql/dbml/2007", false, false, true);
+				}
+			}
+			if (ob. at Items != null) {
+				for (int n30 = 0; n30 < ob. at Items.Length; n30++) {
+					if (((object)ob. at Items[n30]) == null) { }
+					else if (ob. at Items[n30].GetType() == typeof(DbLinq.Schema.Dbml.Return)) {
+						WriteObject_Return (((DbLinq.Schema.Dbml.Return) ob. at Items[n30]), "Return", "http://schemas.microsoft.com/linqtosql/dbml/2007", false, false, true);
+					}
+					else if (ob. at Items[n30].GetType() == typeof(DbLinq.Schema.Dbml.Type)) {
+						WriteObject_Type (((DbLinq.Schema.Dbml.Type) ob. at Items[n30]), "ElementType", "http://schemas.microsoft.com/linqtosql/dbml/2007", false, false, true);
+					}
+					else throw CreateUnknownTypeException (ob. at Items[n30]);
+				}
+			}
+			if (writeWrappingElem) WriteEndElement (ob);
+		}
+
+		void WriteObject_ConnectionMode (DbLinq.Schema.Dbml.ConnectionMode ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
+		{
+			System.Type type = ob.GetType ();
+			if (type == typeof(DbLinq.Schema.Dbml.ConnectionMode))
+			{ }
+			else {
+				throw CreateUnknownTypeException (ob);
+			}
+
+			if (writeWrappingElem) {
+				WriteStartElement (element, namesp, ob);
+			}
+
+			if (needType) WriteXsiType("ConnectionMode", "http://schemas.microsoft.com/linqtosql/dbml/2007");
+
+			Writer.WriteString (GetEnumValue_ConnectionMode (ob));
+			if (writeWrappingElem) WriteEndElement (ob);
+		}
+
+		string GetEnumValue_ConnectionMode (DbLinq.Schema.Dbml.ConnectionMode val)
+		{
+			switch (val) {
+				case DbLinq.Schema.Dbml.ConnectionMode.ConnectionString: return "ConnectionString";
+				case DbLinq.Schema.Dbml.ConnectionMode.AppSettings: return "AppSettings";
+				case DbLinq.Schema.Dbml.ConnectionMode.WebSettings: return "WebSettings";
+				default: throw CreateInvalidEnumValueException ((long) val, typeof (DbLinq.Schema.Dbml.ConnectionMode).FullName);
+			}
+		}
+
+		void WriteObject_MemberModifier (DbLinq.Schema.Dbml.MemberModifier ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
+		{
+			System.Type type = ob.GetType ();
+			if (type == typeof(DbLinq.Schema.Dbml.MemberModifier))
+			{ }
+			else {
+				throw CreateUnknownTypeException (ob);
+			}
+
+			if (writeWrappingElem) {
+				WriteStartElement (element, namesp, ob);
+			}
+
+			if (needType) WriteXsiType("MemberModifier", "http://schemas.microsoft.com/linqtosql/dbml/2007");
+
+			Writer.WriteString (GetEnumValue_MemberModifier (ob));
+			if (writeWrappingElem) WriteEndElement (ob);
+		}
+
+		string GetEnumValue_MemberModifier (DbLinq.Schema.Dbml.MemberModifier val)
+		{
+			switch (val) {
+				case DbLinq.Schema.Dbml.MemberModifier.Virtual: return "Virtual";
+				case DbLinq.Schema.Dbml.MemberModifier.Override: return "Override";
+				case DbLinq.Schema.Dbml.MemberModifier.New: return "New";
+				case DbLinq.Schema.Dbml.MemberModifier.NewVirtual: return "NewVirtual";
+				default: throw CreateInvalidEnumValueException ((long) val, typeof (DbLinq.Schema.Dbml.MemberModifier).FullName);
+			}
+		}
+
+		void WriteObject_Type (DbLinq.Schema.Dbml.Type ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
+		{
+			if (((object)ob) == null)
+			{
+				if (isNullable)
+					WriteNullTagLiteral(element, namesp);
+				return;
+			}
+
+			System.Type type = ob.GetType ();
+			if (type == typeof(DbLinq.Schema.Dbml.Type))
+			{ }
+			else {
+				throw CreateUnknownTypeException (ob);
+			}
+
+			if (writeWrappingElem) {
+				WriteStartElement (element, namesp, ob);
+			}
+
+			if (needType) WriteXsiType("Type", "http://schemas.microsoft.com/linqtosql/dbml/2007");
+
+			WriteAttribute ("IdRef", "", ob. at IdRef);
+			WriteAttribute ("Id", "", ob. at Id);
+			WriteAttribute ("Name", "", ob. at Name);
+			WriteAttribute ("InheritanceCode", "", ob. at InheritanceCode);
+			if (ob. at IsInheritanceDefaultSpecified) {
+				WriteAttribute ("IsInheritanceDefault", "", (ob. at IsInheritanceDefault?"true":"false"));
+			}
+			if (ob. at AccessModifierSpecified) {
+				WriteAttribute ("AccessModifier", "", GetEnumValue_AccessModifier (ob. at AccessModifier));
+			}
+			if (ob. at ModifierSpecified) {
+				WriteAttribute ("Modifier", "", GetEnumValue_ClassModifier (ob. at Modifier));
+			}
+
+			if (ob. at Items != null) {
+				for (int n31 = 0; n31 < ob. at Items.Length; n31++) {
+					if (((object)ob. at Items[n31]) == null) { }
+					else if (ob. at Items[n31].GetType() == typeof(DbLinq.Schema.Dbml.Column)) {
+						WriteObject_Column (((DbLinq.Schema.Dbml.Column) ob. at Items[n31]), "Column", "http://schemas.microsoft.com/linqtosql/dbml/2007", false, false, true);
+					}
+					else if (ob. at Items[n31].GetType() == typeof(DbLinq.Schema.Dbml.Association)) {
+						WriteObject_Association (((DbLinq.Schema.Dbml.Association) ob. at Items[n31]), "Association", "http://schemas.microsoft.com/linqtosql/dbml/2007", false, false, true);
+					}
+					else throw CreateUnknownTypeException (ob. at Items[n31]);
+				}
+			}
+			if (ob. at Type1 != null) {
+				for (int n32 = 0; n32 < ob. at Type1.Length; n32++) {
+					WriteObject_Type (ob. at Type1[n32], "Type", "http://schemas.microsoft.com/linqtosql/dbml/2007", false, false, true);
+				}
+			}
+			if (writeWrappingElem) WriteEndElement (ob);
+		}
+
+		void WriteObject_TableFunction (DbLinq.Schema.Dbml.TableFunction ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
+		{
+			if (((object)ob) == null)
+			{
+				if (isNullable)
+					WriteNullTagLiteral(element, namesp);
+				return;
+			}
+
+			System.Type type = ob.GetType ();
+			if (type == typeof(DbLinq.Schema.Dbml.TableFunction))
+			{ }
+			else {
+				throw CreateUnknownTypeException (ob);
+			}
+
+			if (writeWrappingElem) {
+				WriteStartElement (element, namesp, ob);
+			}
+
+			if (needType) WriteXsiType("TableFunction", "http://schemas.microsoft.com/linqtosql/dbml/2007");
+
+			WriteAttribute ("FunctionId", "", ob. at FunctionId);
+			if (ob. at AccessModifierSpecified) {
+				WriteAttribute ("AccessModifier", "", GetEnumValue_AccessModifier (ob. at AccessModifier));
+			}
+
+			if (ob. at Argument != null) {
+				for (int n33 = 0; n33 < ob. at Argument.Length; n33++) {
+					WriteObject_TableFunctionParameter (ob. at Argument[n33], "Argument", "http://schemas.microsoft.com/linqtosql/dbml/2007", false, false, true);
+				}
+			}
+			WriteObject_TableFunctionReturn (ob. at Return, "Return", "http://schemas.microsoft.com/linqtosql/dbml/2007", false, false, true);
+			if (writeWrappingElem) WriteEndElement (ob);
+		}
+
+		void WriteObject_Parameter (DbLinq.Schema.Dbml.Parameter ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
+		{
+			if (((object)ob) == null)
+			{
+				if (isNullable)
+					WriteNullTagLiteral(element, namesp);
+				return;
+			}
+
+			System.Type type = ob.GetType ();
+			if (type == typeof(DbLinq.Schema.Dbml.Parameter))
+			{ }
+			else {
+				throw CreateUnknownTypeException (ob);
+			}
+
+			if (writeWrappingElem) {
+				WriteStartElement (element, namesp, ob);
+			}
+
+			if (needType) WriteXsiType("Parameter", "http://schemas.microsoft.com/linqtosql/dbml/2007");
+
+			WriteAttribute ("Name", "", ob. at Name);
+			WriteAttribute ("Parameter", "", ob. at Parameter1);
+			WriteAttribute ("Type", "", ob. at Type);
+			WriteAttribute ("DbType", "", ob. at DbType);
+			if (ob. at DirectionSpecified) {
+				WriteAttribute ("Direction", "", GetEnumValue_ParameterDirection (ob. at Direction));
+			}
+
+			if (writeWrappingElem) WriteEndElement (ob);
+		}
+
+		void WriteObject_Return (DbLinq.Schema.Dbml.Return ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
+		{
+			if (((object)ob) == null)
+			{
+				if (isNullable)
+					WriteNullTagLiteral(element, namesp);
+				return;
+			}
+
+			System.Type type = ob.GetType ();
+			if (type == typeof(DbLinq.Schema.Dbml.Return))
+			{ }
+			else {
+				throw CreateUnknownTypeException (ob);
+			}
+
+			if (writeWrappingElem) {
+				WriteStartElement (element, namesp, ob);
+			}
+
+			if (needType) WriteXsiType("Return", "http://schemas.microsoft.com/linqtosql/dbml/2007");
+
+			WriteAttribute ("Type", "", ob. at Type);
+			WriteAttribute ("DbType", "", ob. at DbType);
+
+			if (writeWrappingElem) WriteEndElement (ob);
+		}
+
+		void WriteObject_Column (DbLinq.Schema.Dbml.Column ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
+		{
+			if (((object)ob) == null)
+			{
+				if (isNullable)
+					WriteNullTagLiteral(element, namesp);
+				return;
+			}
+
+			System.Type type = ob.GetType ();
+			if (type == typeof(DbLinq.Schema.Dbml.Column))
+			{ }
+			else {
+				throw CreateUnknownTypeException (ob);
+			}
+
+			if (writeWrappingElem) {
+				WriteStartElement (element, namesp, ob);
+			}
+
+			if (needType) WriteXsiType("Column", "http://schemas.microsoft.com/linqtosql/dbml/2007");
+
+			WriteAttribute ("Name", "", ob. at Name);
+			WriteAttribute ("Member", "", ob. at Member);
+			WriteAttribute ("Storage", "", ob. at Storage);
+			if (ob. at AccessModifierSpecified) {
+				WriteAttribute ("AccessModifier", "", GetEnumValue_AccessModifier (ob. at AccessModifier));
+			}
+			if (ob. at ModifierSpecified) {
+				WriteAttribute ("Modifier", "", GetEnumValue_MemberModifier (ob. at Modifier));
+			}
+			WriteAttribute ("Type", "", ob. at Type);
+			WriteAttribute ("DbType", "", ob. at DbType);
+			if (ob. at IsReadOnlySpecified) {
+				WriteAttribute ("IsReadOnly", "", (ob. at IsReadOnly?"true":"false"));
+			}
+			if (ob. at IsPrimaryKeySpecified) {
+				WriteAttribute ("IsPrimaryKey", "", (ob. at IsPrimaryKey?"true":"false"));
+			}
+			if (ob. at IsDbGeneratedSpecified) {
+				WriteAttribute ("IsDbGenerated", "", (ob. at IsDbGenerated?"true":"false"));
+			}
+			if (ob. at CanBeNullSpecified) {
+				WriteAttribute ("CanBeNull", "", (ob. at CanBeNull?"true":"false"));
+			}
+			if (ob. at UpdateCheckSpecified) {
+				WriteAttribute ("UpdateCheck", "", GetEnumValue_UpdateCheck (ob. at UpdateCheck));
+			}
+			if (ob. at IsDiscriminatorSpecified) {
+				WriteAttribute ("IsDiscriminator", "", (ob. at IsDiscriminator?"true":"false"));
+			}
+			WriteAttribute ("Expression", "", ob. at Expression);
+			if (ob. at IsVersionSpecified) {
+				WriteAttribute ("IsVersion", "", (ob. at IsVersion?"true":"false"));
+			}
+			if (ob. at IsDelayLoadedSpecified) {
+				WriteAttribute ("IsDelayLoaded", "", (ob. at IsDelayLoaded?"true":"false"));
+			}
+			if (ob. at AutoSyncSpecified) {
+				WriteAttribute ("AutoSync", "", GetEnumValue_AutoSync (ob. at AutoSync));
+			}
+
+			if (writeWrappingElem) WriteEndElement (ob);
+		}
+
+		void WriteObject_Association (DbLinq.Schema.Dbml.Association ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
+		{
+			if (((object)ob) == null)
+			{
+				if (isNullable)
+					WriteNullTagLiteral(element, namesp);
+				return;
+			}
+
+			System.Type type = ob.GetType ();
+			if (type == typeof(DbLinq.Schema.Dbml.Association))
+			{ }
+			else {
+				throw CreateUnknownTypeException (ob);
+			}
+
+			if (writeWrappingElem) {
+				WriteStartElement (element, namesp, ob);
+			}
+
+			if (needType) WriteXsiType("Association", "http://schemas.microsoft.com/linqtosql/dbml/2007");
+
+			WriteAttribute ("Name", "", ob. at Name);
+			WriteAttribute ("Member", "", ob. at Member);
+			WriteAttribute ("Storage", "", ob. at Storage);
+			if (ob. at AccessModifierSpecified) {
+				WriteAttribute ("AccessModifier", "", GetEnumValue_AccessModifier (ob. at AccessModifier));
+			}
+			if (ob. at ModifierSpecified) {
+				WriteAttribute ("Modifier", "", GetEnumValue_MemberModifier (ob. at Modifier));
+			}
+			WriteAttribute ("Type", "", ob. at Type);
+			WriteAttribute ("ThisKey", "", ob. at ThisKey);
+			WriteAttribute ("OtherKey", "", ob. at OtherKey);
+			if (ob. at IsForeignKeySpecified) {
+				WriteAttribute ("IsForeignKey", "", (ob. at IsForeignKey?"true":"false"));
+			}
+			if (ob. at CardinalitySpecified) {
+				WriteAttribute ("Cardinality", "", GetEnumValue_Cardinality (ob. at Cardinality));
+			}
+			WriteAttribute ("DeleteRule", "", ob. at DeleteRule);
+			if (ob. at DeleteOnNullSpecified) {
+				WriteAttribute ("DeleteOnNull", "", (ob. at DeleteOnNull?"true":"false"));
+			}
+
+			if (writeWrappingElem) WriteEndElement (ob);
+		}
+
+		void WriteObject_TableFunctionParameter (DbLinq.Schema.Dbml.TableFunctionParameter ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
+		{
+			if (((object)ob) == null)
+			{
+				if (isNullable)
+					WriteNullTagLiteral(element, namesp);
+				return;
+			}
+
+			System.Type type = ob.GetType ();
+			if (type == typeof(DbLinq.Schema.Dbml.TableFunctionParameter))
+			{ }
+			else {
+				throw CreateUnknownTypeException (ob);
+			}
+
+			if (writeWrappingElem) {
+				WriteStartElement (element, namesp, ob);
+			}
+
+			if (needType) WriteXsiType("TableFunctionParameter", "http://schemas.microsoft.com/linqtosql/dbml/2007");
+
+			WriteAttribute ("Parameter", "", ob. at Parameter);
+			WriteAttribute ("Member", "", ob. at Member);
+			if (ob. at VersionSpecified) {
+				WriteAttribute ("Version", "", GetEnumValue_Version (ob. at Version));
+			}
+
+			if (writeWrappingElem) WriteEndElement (ob);
+		}
+
+		void WriteObject_TableFunctionReturn (DbLinq.Schema.Dbml.TableFunctionReturn ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
+		{
+			if (((object)ob) == null)
+			{
+				if (isNullable)
+					WriteNullTagLiteral(element, namesp);
+				return;
+			}
+
+			System.Type type = ob.GetType ();
+			if (type == typeof(DbLinq.Schema.Dbml.TableFunctionReturn))
+			{ }
+			else {
+				throw CreateUnknownTypeException (ob);
+			}
+
+			if (writeWrappingElem) {
+				WriteStartElement (element, namesp, ob);
+			}
+
+			if (needType) WriteXsiType("TableFunctionReturn", "http://schemas.microsoft.com/linqtosql/dbml/2007");
+
+			WriteAttribute ("Member", "", ob. at Member);
+
+			if (writeWrappingElem) WriteEndElement (ob);
+		}
+
+		void WriteObject_ParameterDirection (DbLinq.Schema.Dbml.ParameterDirection ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
+		{
+			System.Type type = ob.GetType ();
+			if (type == typeof(DbLinq.Schema.Dbml.ParameterDirection))
+			{ }
+			else {
+				throw CreateUnknownTypeException (ob);
+			}
+
+			if (writeWrappingElem) {
+				WriteStartElement (element, namesp, ob);
+			}
+
+			if (needType) WriteXsiType("ParameterDirection", "http://schemas.microsoft.com/linqtosql/dbml/2007");
+
+			Writer.WriteString (GetEnumValue_ParameterDirection (ob));
+			if (writeWrappingElem) WriteEndElement (ob);
+		}
+
+		string GetEnumValue_ParameterDirection (DbLinq.Schema.Dbml.ParameterDirection val)
+		{
+			switch (val) {
+				case DbLinq.Schema.Dbml.ParameterDirection.In: return "In";
+				case DbLinq.Schema.Dbml.ParameterDirection.Out: return "Out";
+				case DbLinq.Schema.Dbml.ParameterDirection.InOut: return "InOut";
+				default: throw CreateInvalidEnumValueException ((long) val, typeof (DbLinq.Schema.Dbml.ParameterDirection).FullName);
+			}
+		}
+
+		void WriteObject_UpdateCheck (DbLinq.Schema.Dbml.UpdateCheck ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
+		{
+			System.Type type = ob.GetType ();
+			if (type == typeof(DbLinq.Schema.Dbml.UpdateCheck))
+			{ }
+			else {
+				throw CreateUnknownTypeException (ob);
+			}
+
+			if (writeWrappingElem) {
+				WriteStartElement (element, namesp, ob);
+			}
+
+			if (needType) WriteXsiType("UpdateCheck", "http://schemas.microsoft.com/linqtosql/dbml/2007");
+
+			Writer.WriteString (GetEnumValue_UpdateCheck (ob));
+			if (writeWrappingElem) WriteEndElement (ob);
+		}
+
+		string GetEnumValue_UpdateCheck (DbLinq.Schema.Dbml.UpdateCheck val)
+		{
+			switch (val) {
+				case DbLinq.Schema.Dbml.UpdateCheck.Always: return "Always";
+				case DbLinq.Schema.Dbml.UpdateCheck.Never: return "Never";
+				case DbLinq.Schema.Dbml.UpdateCheck.WhenChanged: return "WhenChanged";
+				default: throw CreateInvalidEnumValueException ((long) val, typeof (DbLinq.Schema.Dbml.UpdateCheck).FullName);
+			}
+		}
+
+		void WriteObject_AutoSync (DbLinq.Schema.Dbml.AutoSync ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
+		{
+			System.Type type = ob.GetType ();
+			if (type == typeof(DbLinq.Schema.Dbml.AutoSync))
+			{ }
+			else {
+				throw CreateUnknownTypeException (ob);
+			}
+
+			if (writeWrappingElem) {
+				WriteStartElement (element, namesp, ob);
+			}
+
+			if (needType) WriteXsiType("AutoSync", "http://schemas.microsoft.com/linqtosql/dbml/2007");
+
+			Writer.WriteString (GetEnumValue_AutoSync (ob));
+			if (writeWrappingElem) WriteEndElement (ob);
+		}
+
+		string GetEnumValue_AutoSync (DbLinq.Schema.Dbml.AutoSync val)
+		{
+			switch (val) {
+				case DbLinq.Schema.Dbml.AutoSync.Never: return "Never";
+				case DbLinq.Schema.Dbml.AutoSync.OnInsert: return "OnInsert";
+				case DbLinq.Schema.Dbml.AutoSync.OnUpdate: return "OnUpdate";
+				case DbLinq.Schema.Dbml.AutoSync.Always: return "Always";
+				case DbLinq.Schema.Dbml.AutoSync.Default: return "Default";
+				default: throw CreateInvalidEnumValueException ((long) val, typeof (DbLinq.Schema.Dbml.AutoSync).FullName);
+			}
+		}
+
+		void WriteObject_Cardinality (DbLinq.Schema.Dbml.Cardinality ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
+		{
+			System.Type type = ob.GetType ();
+			if (type == typeof(DbLinq.Schema.Dbml.Cardinality))
+			{ }
+			else {
+				throw CreateUnknownTypeException (ob);
+			}
+
+			if (writeWrappingElem) {
+				WriteStartElement (element, namesp, ob);
+			}
+
+			if (needType) WriteXsiType("Cardinality", "http://schemas.microsoft.com/linqtosql/dbml/2007");
+
+			Writer.WriteString (GetEnumValue_Cardinality (ob));
+			if (writeWrappingElem) WriteEndElement (ob);
+		}
+
+		string GetEnumValue_Cardinality (DbLinq.Schema.Dbml.Cardinality val)
+		{
+			switch (val) {
+				case DbLinq.Schema.Dbml.Cardinality.One: return "One";
+				case DbLinq.Schema.Dbml.Cardinality.Many: return "Many";
+				default: throw CreateInvalidEnumValueException ((long) val, typeof (DbLinq.Schema.Dbml.Cardinality).FullName);
+			}
+		}
+
+		void WriteObject_Version (DbLinq.Schema.Dbml.Version ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
+		{
+			System.Type type = ob.GetType ();
+			if (type == typeof(DbLinq.Schema.Dbml.Version))
+			{ }
+			else {
+				throw CreateUnknownTypeException (ob);
+			}
+
+			if (writeWrappingElem) {
+				WriteStartElement (element, namesp, ob);
+			}
+
+			if (needType) WriteXsiType("Version", "http://schemas.microsoft.com/linqtosql/dbml/2007");
+
+			Writer.WriteString (GetEnumValue_Version (ob));
+			if (writeWrappingElem) WriteEndElement (ob);
+		}
+
+		string GetEnumValue_Version (DbLinq.Schema.Dbml.Version val)
+		{
+			switch (val) {
+				case DbLinq.Schema.Dbml.Version.Current: return "Current";
+				case DbLinq.Schema.Dbml.Version.Original: return "Original";
+				default: throw CreateInvalidEnumValueException ((long) val, typeof (DbLinq.Schema.Dbml.Version).FullName);
+			}
+		}
+
+		protected override void InitCallbacks ()
+		{
+		}
+
+	}
+
+
+	#if !MONO_STRICT
+    public
+      #endif
+	class BaseXmlSerializer : System.Xml.Serialization.XmlSerializer
+	{
+		protected override System.Xml.Serialization.XmlSerializationReader CreateReader () {
+			return new GeneratedReader ();
+		}
+
+		protected override System.Xml.Serialization.XmlSerializationWriter CreateWriter () {
+			return new GeneratedWriter ();
+		}
+
+		public override bool CanDeserialize (System.Xml.XmlReader xmlReader) {
+			return true;
+		}
+	}
+
+    #if !MONO_STRICT
+    public
+    #endif
+	sealed class DatabaseSerializer : BaseXmlSerializer
+	{
+		protected override void Serialize (object obj, System.Xml.Serialization.XmlSerializationWriter writer) {
+			((GeneratedWriter)writer).WriteRoot_Database(obj);
+		}
+
+		protected override object Deserialize (System.Xml.Serialization.XmlSerializationReader reader) {
+			return ((GeneratedReader)reader).ReadRoot_Database();
+		}
+	}
+
+	#if !TARGET_JVM
+	#if !MONO_STRICT
+    public
+    #endif
+	class XmlSerializerContract : System.Xml.Serialization.XmlSerializerImplementation
+	{
+		System.Collections.Hashtable readMethods = null;
+		System.Collections.Hashtable writeMethods = null;
+		System.Collections.Hashtable typedSerializers = null;
+
+		public override System.Xml.Serialization.XmlSerializationReader Reader {
+			get {
+				return new GeneratedReader();
+			}
+		}
+
+		public override System.Xml.Serialization.XmlSerializationWriter Writer {
+			get {
+				return new GeneratedWriter();
+			}
+		}
+
+		public override System.Collections.Hashtable ReadMethods {
+			get {
+				lock (this) {
+					if (readMethods == null) {
+						readMethods = new System.Collections.Hashtable ();
+						readMethods.Add (@"DbLinq.Schema.Dbml.Database", @"ReadRoot_Database");
+					}
+					return readMethods;
+				}
+			}
+		}
+
+		public override System.Collections.Hashtable WriteMethods {
+			get {
+				lock (this) {
+					if (writeMethods == null) {
+						writeMethods = new System.Collections.Hashtable ();
+						writeMethods.Add (@"DbLinq.Schema.Dbml.Database", @"WriteRoot_Database");
+					}
+					return writeMethods;
+				}
+			}
+		}
+
+		public override System.Collections.Hashtable TypedSerializers {
+			get {
+				lock (this) {
+					if (typedSerializers == null) {
+						typedSerializers = new System.Collections.Hashtable ();
+						typedSerializers.Add (@"DbLinq.Schema.Dbml.Database", new DatabaseSerializer());
+					}
+					return typedSerializers;
+				}
+			}
+		}
+
+		public XmlSerializer GetSerializer (System.Type type)
+		{
+			switch (type.FullName) {
+			case "DbLinq.Schema.Dbml.Database":
+				return (XmlSerializer) TypedSerializers ["DbLinq.Schema.Dbml.Database"];
+
+			}
+			return base.GetSerializer (type);
+		}
+
+		public override bool CanSerialize (System.Type type) {
+			if (type == typeof(DbLinq.Schema.Dbml.Database)) return true;
+			return false;
+		}
+	}
+
+	#endif
+}
+
diff --git a/mcs/class/System.Data.Linq/src/DbLinq/Schema/Dbml/DbmlSerializer.cs b/mcs/class/System.Data.Linq/src/DbLinq/Schema/Dbml/DbmlSerializer.cs
index 790f254..1a7bb72 100644
--- a/mcs/class/System.Data.Linq/src/DbLinq/Schema/Dbml/DbmlSerializer.cs
+++ b/mcs/class/System.Data.Linq/src/DbLinq/Schema/Dbml/DbmlSerializer.cs
@@ -99,7 +99,7 @@ namespace DbLinq.Schema.Dbml
             using (Stream xsdStream = OpenXsd())
             using (XmlReader xmlReader = OpenXml(xmlStream, xsdStream, validationErrors))
             {
-                var xmlSerializer = new XmlSerializer(typeof(Database));
+                var xmlSerializer = new DatabaseSerializer();
                 var dbml = (Database)xmlSerializer.Deserialize(xmlReader);
                 return dbml;
             }
@@ -125,8 +125,8 @@ namespace DbLinq.Schema.Dbml
         /// <param name="dbml">The DBML.</param>
         public static void Write(Stream xmlStream, Database dbml)
         {
-            var xmlSerializer = new XmlSerializer(dbml.GetType());
+            var xmlSerializer = new DatabaseSerializer();
             xmlSerializer.Serialize(xmlStream, dbml);
         }
     }
-}
\ No newline at end of file
+}
diff --git a/mcs/class/System.Data.Linq/src/DbLinq/System.Data.Linq/System.Data.Linq.Mapping/ColumnAttribute.cs b/mcs/class/System.Data.Linq/src/DbLinq/System.Data.Linq/System.Data.Linq.Mapping/ColumnAttribute.cs
index 0516d0a..cc4a006 100644
--- a/mcs/class/System.Data.Linq/src/DbLinq/System.Data.Linq/System.Data.Linq.Mapping/ColumnAttribute.cs
+++ b/mcs/class/System.Data.Linq/src/DbLinq/System.Data.Linq/System.Data.Linq.Mapping/ColumnAttribute.cs
@@ -34,6 +34,11 @@ namespace System.Data.Linq.Mapping
 	[AttributeUsage (AttributeTargets.Property|AttributeTargets.Field, AllowMultiple = false)]
 	public sealed class ColumnAttribute : DataAttribute
 	{
+        public ColumnAttribute()
+        {
+            CanBeNull = true;
+        }
+
 		public AutoSync AutoSync { get; set; }
 		public bool CanBeNull { get; set; }
 		public string DbType { get; set; }
diff --git a/mcs/class/System.Data.Linq/src/DbLinq/Test/AssemblyInfo.cs b/mcs/class/System.Data.Linq/src/DbLinq/Test/AssemblyInfo.cs
index 0dcd4ed..449c509 100644
--- a/mcs/class/System.Data.Linq/src/DbLinq/Test/AssemblyInfo.cs
+++ b/mcs/class/System.Data.Linq/src/DbLinq/Test/AssemblyInfo.cs
@@ -21,15 +21,3 @@ using System.Runtime.InteropServices;
 
 // The following GUID is for the ID of the typelib if this project is exposed to COM
 [assembly: Guid("52112670-1196-4229-ae51-535cf23869cb")]
-
-// Version information for an assembly consists of the following four values:
-//
-//      Major Version
-//      Minor Version 
-//      Build Number
-//      Revision
-//
-// You can specify all the values or you can default the Revision and Build Numbers 
-// by using the '*' as shown below:
-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/mcs/class/System.Data.Linq/src/DbLinq/Test/Properties/AssemblyInfo.cs b/mcs/class/System.Data.Linq/src/DbLinq/Test/Properties/AssemblyInfo.cs
index 0dcd4ed..449c509 100644
--- a/mcs/class/System.Data.Linq/src/DbLinq/Test/Properties/AssemblyInfo.cs
+++ b/mcs/class/System.Data.Linq/src/DbLinq/Test/Properties/AssemblyInfo.cs
@@ -21,15 +21,3 @@ using System.Runtime.InteropServices;
 
 // The following GUID is for the ID of the typelib if this project is exposed to COM
 [assembly: Guid("52112670-1196-4229-ae51-535cf23869cb")]
-
-// Version information for an assembly consists of the following four values:
-//
-//      Major Version
-//      Minor Version 
-//      Build Number
-//      Revision
-//
-// You can specify all the values or you can default the Revision and Build Numbers 
-// by using the '*' as shown below:
-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/mcs/class/System.Data.Linq/src/DbLinq/Test/Providers/Properties/AssemblyInfo.cs b/mcs/class/System.Data.Linq/src/DbLinq/Test/Providers/Properties/AssemblyInfo.cs
index da8098f..c552d99 100644
--- a/mcs/class/System.Data.Linq/src/DbLinq/Test/Providers/Properties/AssemblyInfo.cs
+++ b/mcs/class/System.Data.Linq/src/DbLinq/Test/Providers/Properties/AssemblyInfo.cs
@@ -21,15 +21,3 @@ using System.Runtime.InteropServices;
 
 // The following GUID is for the ID of the typelib if this project is exposed to COM
 [assembly: Guid("0cae4ddc-abd5-4c2a-96c0-918ed1d736e4")]
-
-// Version information for an assembly consists of the following four values:
-//
-//      Major Version
-//      Minor Version 
-//      Build Number
-//      Revision
-//
-// You can specify all the values or you can default the Revision and Build Numbers 
-// by using the '*' as shown below:
-[assembly: AssemblyVersion("0.0.1.17")]
-[assembly: AssemblyFileVersion("0.19")]
diff --git a/mcs/class/System.Data.Linq/src/DbLinq/Test/Providers/ReadTest.cs b/mcs/class/System.Data.Linq/src/DbLinq/Test/Providers/ReadTest.cs
index e452032..1f443c3 100644
--- a/mcs/class/System.Data.Linq/src/DbLinq/Test/Providers/ReadTest.cs
+++ b/mcs/class/System.Data.Linq/src/DbLinq/Test/Providers/ReadTest.cs
@@ -193,11 +193,12 @@ namespace nwind
             Assert.IsTrue(p1.ProductID == 1);
         }
 
+        [Test]
         public void A8_SelectSingleOrDefault_QueryCacheDisabled()
         {
             Northwind db = CreateDB();
 #if !MONO_STRICT
-            db.QueryCacheEnabled = false;
+            db.QueryCacheEnabled = true;
 #endif
 
             // Query for a specific customer
diff --git a/mcs/class/System.Data.Linq/src/DbLinq/Test/System.Data.Linq.Mapping/ColumnAttributeTest.cs b/mcs/class/System.Data.Linq/src/DbLinq/Test/System.Data.Linq.Mapping/ColumnAttributeTest.cs
new file mode 100644
index 0000000..5ff8967
--- /dev/null
+++ b/mcs/class/System.Data.Linq/src/DbLinq/Test/System.Data.Linq.Mapping/ColumnAttributeTest.cs
@@ -0,0 +1,64 @@
+#region MIT license
+// 
+// MIT license
+//
+// Copyright (c) 2010 Novell, Inc.
+// 
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+// 
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+// 
+#endregion
+
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.Data.SqlClient;
+using System.IO;
+using System.Linq;
+using System.Reflection;
+
+using System.Data.Linq.Mapping;
+
+using DbLinq.Null;
+using NUnit.Framework;
+
+namespace System.Data.Linq.Mapping.Test
+{
+    [TestFixture]
+    public class ColumnAttributeTest
+    {
+        [Test]
+        public void Ctor()
+        {
+            var c = new ColumnAttribute();
+            Assert.AreEqual(AutoSync.Default,   c.AutoSync);
+            Assert.AreEqual(true,               c.CanBeNull);
+            Assert.AreEqual(null,               c.DbType);
+            Assert.AreEqual(null,               c.Expression);
+            Assert.AreEqual(false,              c.IsDbGenerated);
+            Assert.AreEqual(false,              c.IsDiscriminator);
+            Assert.AreEqual(false,              c.IsVersion);
+            Assert.AreEqual(UpdateCheck.Always, c.UpdateCheck);
+            Assert.AreEqual(false,              c.IsPrimaryKey);
+            Assert.AreEqual(null,               c.Name);
+            Assert.AreEqual(null,               c.Storage);
+            Assert.AreEqual(c.GetType(),        c.TypeId);
+        }
+    }
+}
diff --git a/mcs/class/System.Data.Linq/src/DbLinq/Vendor/ISchemaLoader.cs b/mcs/class/System.Data.Linq/src/DbLinq/Vendor/ISchemaLoader.cs
index df6f25a..c6b93b0 100644
--- a/mcs/class/System.Data.Linq/src/DbLinq/Vendor/ISchemaLoader.cs
+++ b/mcs/class/System.Data.Linq/src/DbLinq/Vendor/ISchemaLoader.cs
@@ -62,12 +62,5 @@ namespace DbLinq.Vendor
         /// <returns></returns>
         Database Load(string databaseName, INameAliases nameAliases, NameFormat nameFormat,
             bool loadStoredProcedures, string contextNamespace, string entityNamespace);
-
-        /// <summary>
-        /// Checks all names in DBML schema, 
-        /// and enquotes the ones where a casing problem could occur
-        /// </summary>
-        /// <param name="schema"></param>
-        void CheckNamesSafety(Database schema);
     }
 }
diff --git a/mcs/class/System.Data.Linq/src/DbLinq/Vendor/Implementation/SchemaLoader.ForeignKey.cs b/mcs/class/System.Data.Linq/src/DbLinq/Vendor/Implementation/SchemaLoader.ForeignKey.cs
index 696ee87..56ab5bb 100644
--- a/mcs/class/System.Data.Linq/src/DbLinq/Vendor/Implementation/SchemaLoader.ForeignKey.cs
+++ b/mcs/class/System.Data.Linq/src/DbLinq/Vendor/Implementation/SchemaLoader.ForeignKey.cs
@@ -92,7 +92,8 @@ namespace DbLinq.Vendor.Implementation
             assoc.ThisKey = foreignKey;
             assoc.OtherKey = reverseForeignKey;
             assoc.Member = associationName.ManyToOneMemberName;
-            assoc.Cardinality = Cardinality.Many; // TODO: check this is the right direction (even if it appears to be useless)
+            assoc.CardinalitySpecified = false;
+            // TODO: generate assoc.Cardinality?
             table.Type.Associations.Add(assoc);
 
             //and insert the reverse association:
@@ -100,7 +101,8 @@ namespace DbLinq.Vendor.Implementation
             reverseAssociation.Name = constraintName;
             reverseAssociation.Type = table.Type.Name;
             reverseAssociation.Member = associationName.OneToManyMemberName;
-            reverseAssociation.Cardinality = Cardinality.One;
+            reverseAssociation.CardinalitySpecified = false;
+            // TODO: generate reverseAssociation.Cardinality?
             reverseAssociation.ThisKey = reverseForeignKey;
             reverseAssociation.OtherKey = foreignKey;
             reverseAssociation.DeleteRule = "NO ACTION";
diff --git a/mcs/class/System.Data.Linq/src/DbLinq/Vendor/Implementation/SchemaLoader.Name.cs b/mcs/class/System.Data.Linq/src/DbLinq/Vendor/Implementation/SchemaLoader.Name.cs
index fdcfa54..6fed0b8 100644
--- a/mcs/class/System.Data.Linq/src/DbLinq/Vendor/Implementation/SchemaLoader.Name.cs
+++ b/mcs/class/System.Data.Linq/src/DbLinq/Vendor/Implementation/SchemaLoader.Name.cs
@@ -35,32 +35,6 @@ namespace DbLinq.Vendor.Implementation
     partial class SchemaLoader
     {
         /// <summary>
-        /// Checks all names in DBML schema, 
-        /// and enquotes the ones where a casing problem could occur
-        /// </summary>
-        /// <param name="schema"></param>
-        public virtual void CheckNamesSafety(Database schema)
-        {
-            schema.Name = Vendor.SqlProvider.GetSafeName(schema.Name);
-            foreach (var table in schema.Table)
-            {
-                table.Name = Vendor.SqlProvider.GetSafeName(table.Name);
-                foreach (var column in table.Type.Columns)
-                {
-                    column.Name = Vendor.SqlProvider.GetSafeName(column.Name);
-                }
-                foreach (var association in table.Type.Associations)
-                {
-                    association.Name = Vendor.SqlProvider.GetSafeName(association.Name);
-                }
-            }
-            foreach (var storedProcedure in schema.Functions)
-            {
-                storedProcedure.Name = Vendor.SqlProvider.GetSafeName(storedProcedure.Name);
-            }
-        }
-
-        /// <summary>
         /// Gets the primary keys.
         /// </summary>
         /// <param name="table">The table.</param>
@@ -149,22 +123,36 @@ namespace DbLinq.Vendor.Implementation
                     column.Storage = storageGenerator(column.Member);
                 }
 
-                Dictionary<string, int> storageFields = new Dictionary<string,int>();
-                Dictionary<string, int> memberFields = new Dictionary<string,int>();
+                HashSet<string> storageFields = new HashSet<string>();
+                HashSet<string> memberFields = new HashSet<string>();
+                foreach (var column in table.Type.Columns)
+                {
+                    storageFields.Add(column.Storage);
+                    memberFields.Add(column.Member);
+                }
+
                 foreach (var association in table.Type.Associations)
                 {
                     association.Storage = storageGenerator(association.Member);
 
                     //Associations may contain the same foreign key more than once - add a number suffix to duplicates
-                    int storageSuffix = 0;
-                    if ( storageFields.TryGetValue(association.Storage, out storageSuffix) )
-                        association.Storage += storageSuffix;
-                    storageFields[association.Storage] = storageSuffix + 1;
+                    for (var suffix = 0; ; suffix++)
+                    {
+                        var name = suffix == 0 ? association.Storage : association.Storage + suffix;
+                        if (storageFields.Contains(name)) continue;
+                        association.Storage = name;
+                        storageFields.Add(name);
+                        break;
+                    }
 
-                    int memberSuffix = 0;
-                    if ( memberFields.TryGetValue(association.Member, out memberSuffix) )
-                        association.Member += memberSuffix;
-                    memberFields[association.Member] = memberSuffix + 1;
+                    for (var suffix = 0; ; suffix++)
+                    {
+                        var name = suffix == 0 ? association.Member : association.Member + suffix;
+                        if (memberFields.Contains(name)) continue;
+                        association.Member = name;
+                        memberFields.Add(name);
+                        break;
+                    }
                 }
             }
         }
diff --git a/mcs/class/System.Data.Linq/src/DbLinq/Vendor/Implementation/SchemaLoader.TypeMapping.cs b/mcs/class/System.Data.Linq/src/DbLinq/Vendor/Implementation/SchemaLoader.TypeMapping.cs
index 2f179d3..ba67047 100644
--- a/mcs/class/System.Data.Linq/src/DbLinq/Vendor/Implementation/SchemaLoader.TypeMapping.cs
+++ b/mcs/class/System.Data.Linq/src/DbLinq/Vendor/Implementation/SchemaLoader.TypeMapping.cs
@@ -147,12 +147,16 @@ namespace DbLinq.Vendor.Implementation
             case "float4":
             case "real":
             case "binary_float":   // oracle type
+            case "unsigned float": // mysql type
+            case "float unsigned": // mysql type
                 return typeof(Single);
 
             // double
             case "double":
             case "double precision":
             case "binary_double":  // oracle type
+            case "unsigned double":// mysql type
+            case "double unsigned":// mysql type
                 return typeof(Double);
 
             // decimal
@@ -180,6 +184,7 @@ namespace DbLinq.Vendor.Implementation
 
             //enum
             case "enum":
+            case "set":
                 return MapEnumDbType(dataType);
 
             // date
@@ -188,6 +193,7 @@ namespace DbLinq.Vendor.Implementation
             case "ingresdate":
             case "timestamp":
             case "timestamp without time zone":
+            case "timestamp with time zone":
             case "time":
             case "time without time zone": //reported by twain_bu... at msn.com,
             case "time with time zone":
@@ -430,7 +436,7 @@ namespace DbLinq.Vendor.Implementation
             #endregion
         }
 
-        protected static Regex DefaultEnumDefinitionEx = new Regex(@"\s*enum\s*\((?<values>.*)\s*\)\s*", RegexOptions.Compiled);
+        protected static Regex DefaultEnumDefinitionEx = new Regex(@"\s*(enum|set)\s*\((?<values>.*)\s*\)\s*", RegexOptions.Compiled);
         protected static Regex EnumValuesEx = new Regex(@"\'(?<value>\w*)\'\s*,?\s*", RegexOptions.Compiled);
 
         /// <summary>
diff --git a/mcs/class/System.Data.Linq/src/DbLinq/Vendor/Implementation/SchemaLoader.cs b/mcs/class/System.Data.Linq/src/DbLinq/Vendor/Implementation/SchemaLoader.cs
index 528fc0a..ef05fc5 100644
--- a/mcs/class/System.Data.Linq/src/DbLinq/Vendor/Implementation/SchemaLoader.cs
+++ b/mcs/class/System.Data.Linq/src/DbLinq/Vendor/Implementation/SchemaLoader.cs
@@ -38,6 +38,7 @@ using DbLinq.Data.Linq;
 using DbLinq.Factory;
 using DbLinq.Schema;
 using DbLinq.Schema.Dbml;
+using System.Text.RegularExpressions;
 
 namespace DbLinq.Vendor.Implementation
 {
@@ -237,6 +238,8 @@ namespace DbLinq.Vendor.Implementation
             return CreateTableName(dbTableName, dbSchema, nameAliases, nameFormat, GetExtraction(dbTableName));
         }
 
+        Regex startsWithNumber = new Regex(@"^\d", RegexOptions.Compiled);
+
         /// <summary>
         /// Creates the name of the column.
         /// </summary>
@@ -265,6 +268,10 @@ namespace DbLinq.Vendor.Implementation
             var tableName = CreateTableName(dbTableName, dbSchema, nameAliases, nameFormat);
             if (columnName.PropertyName == tableName.ClassName)
                 columnName.PropertyName = columnName.PropertyName + "1";
+
+            if (startsWithNumber.IsMatch(columnName.PropertyName))
+                columnName.PropertyName = "_" + columnName.PropertyName;
+
             columnName.DbName = dbColumnName;
             return columnName;
         }
diff --git a/mcs/class/System.Data.Linq/src/DbLinq/Vendor/Implementation/SqlProvider.cs b/mcs/class/System.Data.Linq/src/DbLinq/Vendor/Implementation/SqlProvider.cs
index a2d0d0c..2ede68f 100644
--- a/mcs/class/System.Data.Linq/src/DbLinq/Vendor/Implementation/SqlProvider.cs
+++ b/mcs/class/System.Data.Linq/src/DbLinq/Vendor/Implementation/SqlProvider.cs
@@ -1587,11 +1587,7 @@ namespace DbLinq.Vendor.Implementation
         /// <returns></returns>
         protected virtual string GetSafeNamePart(string namePart)
         {
-            if (IsMadeSafe(namePart))
-                return namePart;
-            if (IsNameSafe(namePart) && IsNameCaseSafe(namePart))
-                return namePart;
-            return MakeNameSafe(namePart);
+            return IsMadeSafe(namePart) ? namePart : MakeNameSafe(namePart);
         }
 
         /// <summary>
@@ -1610,23 +1606,6 @@ namespace DbLinq.Vendor.Implementation
         }
 
         /// <summary>
-        /// Determines whether [is name case safe] [the specified name part].
-        /// </summary>
-        /// <param name="namePart">The name part.</param>
-        /// <returns>
-        ///     <c>true</c> if [is name case safe] [the specified name part]; otherwise, <c>false</c>.
-        /// </returns>
-        protected virtual bool IsNameCaseSafe(string namePart)
-        {
-            foreach (char c in namePart)
-            {
-                if (char.IsLower(c))
-                    return false;
-            }
-            return true;
-        }
-
-        /// <summary>
         /// Gets the safe name start quote.
         /// </summary>
         /// <value>The safe name start quote.</value>
@@ -1647,53 +1626,6 @@ namespace DbLinq.Vendor.Implementation
             return namePart.Enquote(SafeNameStartQuote, SafeNameEndQuote);
         }
 
-        /// <summary>
-        /// Determines if a given field is dangerous (related to a SQL keyword or containing problematic characters)
-        /// </summary>
-        protected virtual bool IsNameSafe(string name)
-        {
-            var nameL = name.ToLower();
-            switch (nameL)
-            {
-            case "user":
-            case "default":
-            case "bit":
-            case "int":
-            case "smallint":
-            case "tinyint":
-            case "mediumint":
-
-            case "float":
-            case "double":
-            case "real":
-            case "decimal":
-            case "numeric":
-
-            case "blob":
-            case "text":
-            case "char":
-            case "varchar":
-
-            case "date":
-            case "time":
-            case "datetime":
-            case "timestamp":
-            case "year":
-
-            case "select":
-            case "from":
-            case "where":
-            case "order":
-            case "by":
-            case "key":
-			case "index":
-
-                return false;
-            default:
-                return !name.Contains(' ');
-            }
-        }
-
         private static readonly Regex _fieldIdentifierEx = new Regex(@"\[(?<var>[\w.]+)\]",
                                                                      RegexOptions.Singleline |
                                                                      RegexOptions.ExplicitCapture |
diff --git a/mcs/class/System.Data.Linq/src/DbLinq/Vendor/Implementation/Vendor.cs b/mcs/class/System.Data.Linq/src/DbLinq/Vendor/Implementation/Vendor.cs
index 6a28f53..c9b68f5 100644
--- a/mcs/class/System.Data.Linq/src/DbLinq/Vendor/Implementation/Vendor.cs
+++ b/mcs/class/System.Data.Linq/src/DbLinq/Vendor/Implementation/Vendor.cs
@@ -39,6 +39,7 @@ using DbLinq.Data.Linq;
 using Data = DbLinq.Data;
 
 using IExecuteResult = System.Data.Linq.IExecuteResult;
+using System.Text;
 
 namespace DbLinq.Vendor.Implementation
 {
@@ -134,10 +135,43 @@ namespace DbLinq.Vendor.Implementation
         /// <param name="parts">The parts.</param>
         /// <param name="name">The name.</param>
         /// <param name="value">The value.</param>
-        protected virtual void AddConnectionStringPart(IList<string> parts, string name, string value)
+        protected void AppendConnectionString(StringBuilder connectionString, string name, string value)
         {
             if (!string.IsNullOrEmpty(value) && !string.IsNullOrEmpty(name))
-                parts.Add(string.Format("{0}={1}", name, value));
+                connectionString.AppendFormat("{0}={1};", name, value);
+        }
+
+        protected virtual void AppendDatabase(StringBuilder connectionString, string databaseName)
+        {
+            AppendConnectionString(connectionString, ConnectionStringDatabase, databaseName);
+        }
+
+        protected virtual void AppendPassword(StringBuilder connectionString, string password)
+        {
+            AppendConnectionString(connectionString, ConnectionStringPassword, password);
+        }
+
+        protected virtual void AppendServer(StringBuilder connectionString, string host)
+        {
+            // A majority of databases want a server/host port number as a separate key:
+            //      http://www.connectionstrings.com/postgre-sql
+            //      http://www.connectionstrings.com/firebird
+            //      http://www.connectionstrings.com/mysql
+            // So make this the default.
+            if (host == null)
+                return;
+            var colonIdx = host.IndexOf(':');
+            string port = colonIdx < 0 || host.Length == (colonIdx + 1) ? null : host.Substring(colonIdx + 1);
+            if (colonIdx >= 0)
+                host = host.Substring(0, colonIdx);
+            AppendConnectionString(connectionString, ConnectionStringServer, host);
+            if (port != null)
+                AppendConnectionString(connectionString, "Port", port);
+        }
+
+        protected virtual void AppendUser(StringBuilder connectionString, string userName)
+        {
+            AppendConnectionString(connectionString, ConnectionStringUser, userName);
         }
 
         /// <summary>
@@ -150,12 +184,12 @@ namespace DbLinq.Vendor.Implementation
         /// <returns></returns>
         public virtual string BuildConnectionString(string host, string databaseName, string userName, string password)
         {
-            var connectionStringParts = new List<string>();
-            AddConnectionStringPart(connectionStringParts, ConnectionStringServer, host);
-            AddConnectionStringPart(connectionStringParts, ConnectionStringDatabase, databaseName);
-            AddConnectionStringPart(connectionStringParts, ConnectionStringUser, userName);
-            AddConnectionStringPart(connectionStringParts, ConnectionStringPassword, password);
-            return string.Join(";", connectionStringParts.ToArray());
+            var connectionString = new StringBuilder();
+            AppendServer(connectionString, host);
+            AppendDatabase(connectionString, databaseName);
+            AppendUser(connectionString, userName);
+            AppendPassword(connectionString, password);
+            return connectionString.ToString();
         }
 
         /// <summary>
diff --git a/mcs/class/System.Data.Linq/src/DbMetal/Configuration/ProvidersSection.cs b/mcs/class/System.Data.Linq/src/DbMetal/Configuration/ProvidersSection.cs
index 94dafb9..73d26d6 100644
--- a/mcs/class/System.Data.Linq/src/DbMetal/Configuration/ProvidersSection.cs
+++ b/mcs/class/System.Data.Linq/src/DbMetal/Configuration/ProvidersSection.cs
@@ -24,9 +24,11 @@
 // 
 #endregion
 using System;
+using System.IO;
 using System.Linq;
 using System.Collections.Generic;
 using System.Configuration;
+using System.Text;
 
 namespace DbMetal.Configuration
 {
@@ -91,15 +93,31 @@ namespace DbMetal.Configuration
                     string[] allKeyStrings = allKeys.OfType<string>().ToArray();
                     
                     element = null;
-                    error = allKeys.Length == 0 
-                        ? "There are no <provider> entries in your app.config"
-                        : "Key " + name + " not found among " + allKeys.Length + " config entries {" + string.Join(",",allKeyStrings) + "}";
+                    string configFile = Path.GetFileName(typeof(Program).Assembly.Location)+ ".config";
+                    error = allKeys.Length == 0
+                        ? string.Format("There are no <provider/> entries in your {0} file.", configFile)
+                        : GetProvidersDescription(name, allKeyStrings.Length, configFile);
                     return false;
                 }
                 element = (ProviderElement)BaseGet(name.ToLower());
                 error = null;
                 return true;
             }
+
+            private string GetProvidersDescription(string name, int numKeys, string configFile)
+            {
+                var message = new StringBuilder();
+                message.AppendFormat("Provider '{0}' not found among the {1} config entries in your {2} file.  ",
+                    name, numKeys, configFile);
+                message.AppendLine("Valid providers include:");
+                foreach (ProviderElement p in this.Cast<ProviderElement>().OrderBy(e => e.Name))
+                {
+                    message.AppendFormat("\t{0} [{1}]",
+                        p.Name, p.DatabaseConnection);
+                    message.AppendLine();
+                }
+                return message.ToString();
+            }
         }
 
         [ConfigurationProperty("providers", IsDefaultCollection = true)]
diff --git a/mcs/class/System.Data.Linq/src/DbMetal/Generator/CodeDomGenerator.cs b/mcs/class/System.Data.Linq/src/DbMetal/Generator/CodeDomGenerator.cs
new file mode 100644
index 0000000..c52bbeb
--- /dev/null
+++ b/mcs/class/System.Data.Linq/src/DbMetal/Generator/CodeDomGenerator.cs
@@ -0,0 +1,1474 @@
+#region MIT license
+// 
+// MIT license
+//
+// Copyright (c) 2007-2008 Jiri Moudry, Pascal Craponne
+// 
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+// 
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+// 
+#endregion
+using System;
+using System.CodeDom;
+using System.CodeDom.Compiler;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Data.Linq.Mapping;
+using System.IO;
+using System.Linq;
+using System.Reflection;
+using System.Text;
+using System.Text.RegularExpressions;
+
+using Microsoft.CSharp;
+using Microsoft.VisualBasic;
+
+using DbLinq.Schema.Dbml;
+using DbLinq.Schema.Dbml.Adapter;
+using DbLinq.Util;
+
+namespace DbMetal.Generator
+{
+#if !MONO_STRICT
+    public
+#endif
+    class CodeDomGenerator : ICodeGenerator
+    {
+        CodeDomProvider Provider { get; set; }
+
+        // Provided only for Processor.EnumerateCodeGenerators().  DO NOT USE.
+        public CodeDomGenerator()
+        {
+        }
+
+        public CodeDomGenerator(CodeDomProvider provider)
+        {
+            this.Provider = provider;
+        }
+
+        public string LanguageCode {
+            get { return "*"; }
+        }
+
+        public string Extension {
+            get { return "*"; }
+        }
+
+        public static CodeDomGenerator CreateFromFileExtension(string extension)
+        {
+            return CreateFromLanguage(CodeDomProvider.GetLanguageFromExtension(extension));
+        }
+
+        public static CodeDomGenerator CreateFromLanguage(string language)
+        {
+            return new CodeDomGenerator(CodeDomProvider.CreateProvider(language));
+        }
+
+        public void Write(TextWriter textWriter, Database dbSchema, GenerationContext context)
+        {
+            Context = context;
+            Provider.CreateGenerator(textWriter).GenerateCodeFromNamespace(
+                GenerateCodeDomModel(dbSchema), textWriter, 
+                new CodeGeneratorOptions() {
+                    BracingStyle = "C",
+                    IndentString = "\t",
+                });
+        }
+
+        static void Warning(string format, params object[] args)
+        {
+            Console.Error.Write(Path.GetFileName(Environment.GetCommandLineArgs()[0]));
+            Console.Error.Write(": warning: ");
+            Console.Error.WriteLine(format, args);
+        }
+
+        private CodeTypeMember CreatePartialMethod(string methodName, params CodeParameterDeclarationExpression[] parameters)
+        {
+            string prototype = null;
+            if (Provider is CSharpCodeProvider)
+            {
+                prototype =
+                    "\t\tpartial void {0}({1});" + Environment.NewLine +
+                    "\t\t";
+            }
+            else if (Provider is VBCodeProvider)
+            {
+                prototype =
+                    "\t\tPartial Private Sub {0}({1})" + Environment.NewLine +
+                    "\t\tEnd Sub" + Environment.NewLine +
+                    "\t\t";
+            }
+
+            if (prototype == null)
+            {
+                var method = new CodeMemberMethod() {
+                    Name = methodName,
+                };
+                method.Parameters.AddRange(parameters);
+                return method;
+            }
+
+            var methodDecl = new StringWriter();
+            var gen = Provider.CreateGenerator(methodDecl);
+
+            bool comma = false;
+            foreach (var p in parameters)
+            {
+                if (comma)
+                    methodDecl.Write(", ");
+                comma = true;
+                gen.GenerateCodeFromExpression(p, methodDecl, null);
+            }
+            return new CodeSnippetTypeMember(string.Format(prototype, methodName, methodDecl.ToString()));
+        }
+
+        CodeThisReferenceExpression thisReference = new CodeThisReferenceExpression();
+
+        protected GenerationContext Context { get; set; }
+
+        protected virtual CodeNamespace GenerateCodeDomModel(Database database)
+        {
+            CodeNamespace _namespace = new CodeNamespace(Context.Parameters.Namespace ?? database.ContextNamespace);
+
+            _namespace.Imports.Add(new CodeNamespaceImport("System"));
+            _namespace.Imports.Add(new CodeNamespaceImport("System.ComponentModel"));
+#if MONO_STRICT
+            _namespace.Imports.Add(new CodeNamespaceImport("System.Data"));
+            _namespace.Imports.Add(new CodeNamespaceImport("System.Data.Linq"));
+            _namespace.Imports.Add(new CodeNamespaceImport("System.Data.Linq.Mapping"));
+#else
+            AddConditionalImports(_namespace.Imports,
+                "System.Data",
+                "MONO_STRICT",
+                new[] { "System.Data.Linq" },
+                new[] { "DbLinq.Data.Linq", "DbLinq.Vendor" },
+                "System.Data.Linq.Mapping");
+#endif
+            _namespace.Imports.Add(new CodeNamespaceImport("System.Diagnostics"));
+
+            var time = Context.Parameters.GenerateTimestamps ? DateTime.Now.ToString("u") : "[TIMESTAMP]";
+            var header = new CodeCommentStatement(GenerateCommentBanner(database, time));
+            _namespace.Comments.Add(header);
+
+            _namespace.Types.Add(GenerateContextClass(database));
+#if !MONO_STRICT
+            _namespace.Types.Add(GenerateMonoStrictContextConstructors(database));
+            _namespace.Types.Add(GenerateNotMonoStrictContextConstructors(database));
+#endif
+
+            foreach (Table table in database.Tables)
+                _namespace.Types.Add(GenerateTableClass(table, database));
+            return _namespace;
+        }
+
+        void AddConditionalImports(CodeNamespaceImportCollection imports,
+                string firstImport,
+                string conditional,
+                string[] importsIfTrue,
+                string[] importsIfFalse,
+                string lastImport)
+        {
+            if (Provider is CSharpCodeProvider)
+            {
+                // HACK HACK HACK
+                // Would be better if CodeDom actually supported conditional compilation constructs...
+                // This is predecated upon CSharpCodeGenerator.GenerateNamespaceImport() being implemented as:
+                //      output.Write ("using ");
+                //      output.Write (GetSafeName (import.Namespace));
+                //      output.WriteLine (';');
+                // Thus, with "crafty" execution of the namespace, we can stuff arbitrary text in there...
+
+                var block = new StringBuilder();
+                // No 'using', as GenerateNamespaceImport() writes it.
+                block.Append(firstImport).Append(";").Append(Environment.NewLine);
+                block.Append("#if ").Append(conditional).Append(Environment.NewLine);
+                foreach (var ns in importsIfTrue)
+                    block.Append("\tusing ").Append(ns).Append(";").Append(Environment.NewLine);
+                block.Append("#else   // ").Append(conditional).Append(Environment.NewLine);
+                foreach (var ns in importsIfFalse)
+                    block.Append("\tusing ").Append(ns).Append(";").Append(Environment.NewLine);
+                block.Append("#endif  // ").Append(conditional).Append(Environment.NewLine);
+                block.Append("\tusing ").Append(lastImport);
+                // No ';', as GenerateNamespaceImport() writes it.
+
+                imports.Add(new CodeNamespaceImport(block.ToString()));
+            }
+            else if (Provider is VBCodeProvider)
+            {
+                // HACK HACK HACK
+                // Would be better if CodeDom actually supported conditional compilation constructs...
+                // This is predecated upon VBCodeGenerator.GenerateNamespaceImport() being implemented as:
+                //      output.Write ("Imports ");
+                //      output.Write (import.Namespace);
+                //      output.WriteLine ();
+                // Thus, with "crafty" execution of the namespace, we can stuff arbitrary text in there...
+
+                var block = new StringBuilder();
+                // No 'Imports', as GenerateNamespaceImport() writes it.
+                block.Append(firstImport).Append(Environment.NewLine);
+                block.Append("#If ").Append(conditional).Append(" Then").Append(Environment.NewLine);
+                foreach (var ns in importsIfTrue)
+                    block.Append("Imports ").Append(ns).Append(Environment.NewLine);
+                block.Append("#Else     ' ").Append(conditional).Append(Environment.NewLine);
+                foreach (var ns in importsIfFalse)
+                    block.Append("Imports ").Append(ns).Append(Environment.NewLine);
+                block.Append("#End If   ' ").Append(conditional).Append(Environment.NewLine);
+                block.Append("Imports ").Append(lastImport);
+                // No newline, as GenerateNamespaceImport() writes it.
+
+                imports.Add(new CodeNamespaceImport(block.ToString()));
+            }
+            else
+            {
+                // Default to using the DbLinq imports
+                imports.Add(new CodeNamespaceImport(firstImport));
+                foreach (var ns in importsIfTrue)
+                    imports.Add(new CodeNamespaceImport(ns));
+                imports.Add(new CodeNamespaceImport(lastImport));
+            }
+        }
+
+        private string GenerateCommentBanner(Database database, string time)
+        {
+            var result = new StringBuilder();
+
+            // http://www.network-science.de/ascii/
+            // http://www.network-science.de/ascii/ascii.php?TEXT=MetalSequel&x=14&y=14&FONT=_all+fonts+with+your+text_&RICH=no&FORM=left&STRE=no&WIDT=80 
+            result.Append(
+                @"
+  ____  _     __  __      _        _ 
+ |  _ \| |__ |  \/  | ___| |_ __ _| |
+ | | | | '_ \| |\/| |/ _ \ __/ _` | |
+ | |_| | |_) | |  | |  __/ || (_| | |
+ |____/|_.__/|_|  |_|\___|\__\__,_|_|
+
+");
+            result.AppendLine(String.Format(" Auto-generated from {0} on {1}.", database.Name, time));
+            result.AppendLine(" Please visit http://code.google.com/p/dblinq2007/ for more information.");
+
+            return result.ToString();
+        }
+
+        protected virtual CodeTypeDeclaration GenerateContextClass(Database database)
+        {
+            var _class = new CodeTypeDeclaration() {
+                IsClass         = true, 
+                IsPartial       = true, 
+                Name            = database.Class, 
+                TypeAttributes  = TypeAttributes.Public 
+            };
+
+            _class.BaseTypes.Add(GetContextBaseType(database.BaseType));
+
+            var onCreated = CreatePartialMethod("OnCreated");
+            onCreated.StartDirectives.Add(new CodeRegionDirective(CodeRegionMode.Start, "Extensibility Method Declarations"));
+            onCreated.EndDirectives.Add(new CodeRegionDirective(CodeRegionMode.End, null));
+            _class.Members.Add(onCreated);
+
+            // Implement Constructor
+            GenerateContextConstructors(_class, database);
+
+            foreach (Table table in database.Tables)
+            {
+                var tableType = new CodeTypeReference(table.Type.Name);
+                var property = new CodeMemberProperty() {
+                    Attributes  = MemberAttributes.Public | MemberAttributes.Final,
+                    Name        = table.Member, 
+                    Type        = new CodeTypeReference("Table", tableType), 
+                };
+                property.GetStatements.Add(
+                    new CodeMethodReturnStatement(
+                        new CodeMethodInvokeExpression(
+                            new CodeMethodReferenceExpression(thisReference, "GetTable", tableType))));
+                _class.Members.Add(property);
+            }
+
+            foreach (var function in database.Functions)
+            {
+                GenerateContextFunction(_class, function);
+            }
+
+            return _class;
+        }
+
+        static string GetContextBaseType(string type)
+        {
+            string baseType = "DataContext";
+
+            if (!string.IsNullOrEmpty(type))
+            {
+                var t = TypeLoader.Load(type);
+                if (t != null)
+                    baseType = t.Name;
+            }
+
+            return baseType;
+        }
+
+        void GenerateContextConstructors(CodeTypeDeclaration contextType, Database database)
+        {
+            // .ctor(string connectionString);
+            var constructor = new CodeConstructor() {
+                Attributes = MemberAttributes.Public,
+                Parameters = { new CodeParameterDeclarationExpression(typeof(string), "connectionString") },
+            };
+            constructor.BaseConstructorArgs.Add(new CodeArgumentReferenceExpression("connectionString"));
+            constructor.Statements.Add(new CodeExpressionStatement(new CodeMethodInvokeExpression(thisReference, "OnCreated")));
+            contextType.Members.Add(constructor);
+
+#if MONO_STRICT
+            // .ctor(IDbConnection connection);
+            constructor = new CodeConstructor() {
+                Attributes = MemberAttributes.Public,
+                Parameters = { new CodeParameterDeclarationExpression("IDbConnection", "connection") },
+            };
+            constructor.BaseConstructorArgs.Add(new CodeArgumentReferenceExpression("connection"));
+            constructor.Statements.Add(new CodeExpressionStatement(new CodeMethodInvokeExpression(thisReference, "OnCreated")));
+            contextType.Members.Add(constructor);
+#endif
+
+            // .ctor(string connection, MappingSource mappingSource);
+            constructor = new CodeConstructor() {
+                Attributes = MemberAttributes.Public,
+                Parameters = { 
+                    new CodeParameterDeclarationExpression(typeof(string), "connection"),
+                    new CodeParameterDeclarationExpression("MappingSource", "mappingSource"),
+                },
+            };
+            constructor.BaseConstructorArgs.Add(new CodeArgumentReferenceExpression("connection"));
+            constructor.BaseConstructorArgs.Add(new CodeArgumentReferenceExpression("mappingSource"));
+            constructor.Statements.Add(new CodeExpressionStatement(new CodeMethodInvokeExpression(thisReference, "OnCreated")));
+            contextType.Members.Add(constructor);
+
+            // .ctor(IDbConnection connection, MappingSource mappingSource);
+            constructor = new CodeConstructor() {
+                Attributes = MemberAttributes.Public,
+                Parameters = { 
+                    new CodeParameterDeclarationExpression("IDbConnection", "connection"),
+                    new CodeParameterDeclarationExpression("MappingSource", "mappingSource"),
+                },
+            };
+            constructor.BaseConstructorArgs.Add(new CodeArgumentReferenceExpression("connection"));
+            constructor.BaseConstructorArgs.Add(new CodeArgumentReferenceExpression("mappingSource"));
+            constructor.Statements.Add(new CodeExpressionStatement(new CodeMethodInvokeExpression(thisReference, "OnCreated")));
+            contextType.Members.Add(constructor);
+        }
+
+        CodeTypeDeclaration GenerateMonoStrictContextConstructors(Database database)
+        {
+            var contextType = new CodeTypeDeclaration()
+            {
+                IsClass         = true,
+                IsPartial       = true,
+                Name            = database.Class,
+                TypeAttributes  = TypeAttributes.Public
+            };
+            AddConditionalIfElseBlocks(contextType, "MONO_STRICT");
+
+            // .ctor(IDbConnection connection);
+            var constructor = new CodeConstructor() {
+                Attributes = MemberAttributes.Public,
+                Parameters = { new CodeParameterDeclarationExpression("IDbConnection", "connection") },
+            };
+            constructor.BaseConstructorArgs.Add(new CodeArgumentReferenceExpression("connection"));
+            constructor.Statements.Add(new CodeExpressionStatement(new CodeMethodInvokeExpression(thisReference, "OnCreated")));
+            contextType.Members.Add(constructor);
+
+            return contextType;
+        }
+
+        void AddConditionalIfElseBlocks(CodeTypeMember member, string condition)
+        {
+            string startIf = null, elseIf = null;
+            if (Provider is CSharpCodeProvider)
+            {
+                startIf = string.Format("Start {0}{1}#if {0}{1}", condition, Environment.NewLine);
+                elseIf  = string.Format("End {0}{1}\t#endregion{1}#else     // {0}", condition, Environment.NewLine);
+            }
+            if (Provider is VBCodeProvider)
+            {
+                startIf = string.Format("Start {0}\"{1}#If {0} Then{1}    '", condition, Environment.NewLine);
+                elseIf  = string.Format("End {0}\"{1}\t#End Region{1}#Else     ' {0}", condition, Environment.NewLine);
+            }
+            if (startIf != null && elseIf != null)
+            {
+                member.StartDirectives.Add(new CodeRegionDirective(CodeRegionMode.Start, startIf));
+                member.EndDirectives.Add(new CodeRegionDirective(CodeRegionMode.Start, elseIf));
+            }
+        }
+
+        void AddConditionalEndifBlocks(CodeTypeMember member, string condition)
+        {
+            string endIf = null;
+            if (Provider is CSharpCodeProvider)
+            {
+                endIf   = string.Format("End Not {0}{1}\t#endregion{1}#endif     // {0}", condition, Environment.NewLine);
+            }
+            if (Provider is VBCodeProvider)
+            {
+                endIf   = string.Format("End Not {0}\"{1}\t#End Region{1}#End If     ' {0}", condition, Environment.NewLine);
+            }
+            if (endIf != null)
+            {
+                member.EndDirectives.Add(new CodeRegionDirective(CodeRegionMode.Start, endIf));
+                member.EndDirectives.Add(new CodeRegionDirective(CodeRegionMode.End, null));
+            }
+        }
+
+        CodeTypeDeclaration GenerateNotMonoStrictContextConstructors(Database database)
+        {
+            var contextType = new CodeTypeDeclaration() {
+                IsClass         = true,
+                IsPartial       = true,
+                Name            = database.Class,
+                TypeAttributes  = TypeAttributes.Public
+            };
+            AddConditionalEndifBlocks(contextType, "MONO_STRICT");
+
+            // .ctor(IDbConnection connection);
+            var constructor = new CodeConstructor() {
+                Attributes = MemberAttributes.Public,
+                Parameters = { new CodeParameterDeclarationExpression("IDbConnection", "connection") },
+            };
+            constructor.BaseConstructorArgs.Add(new CodeArgumentReferenceExpression("connection"));
+            constructor.BaseConstructorArgs.Add(new CodeObjectCreateExpression(Context.SchemaLoader.Vendor.GetType()));
+            constructor.Statements.Add(new CodeExpressionStatement(new CodeMethodInvokeExpression(thisReference, "OnCreated")));
+            contextType.Members.Add(constructor);
+
+            // .ctor(IDbConnection connection, IVendor mappingSource);
+            constructor = new CodeConstructor() {
+                Attributes = MemberAttributes.Public,
+                Parameters = {
+                    new CodeParameterDeclarationExpression("IDbConnection", "connection"),
+                    new CodeParameterDeclarationExpression("IVendor", "sqlDialect"),
+                },
+            };
+            constructor.BaseConstructorArgs.Add(new CodeArgumentReferenceExpression("connection"));
+            constructor.BaseConstructorArgs.Add(new CodeArgumentReferenceExpression("sqlDialect"));
+            constructor.Statements.Add(new CodeExpressionStatement(new CodeMethodInvokeExpression(thisReference, "OnCreated")));
+            contextType.Members.Add(constructor);
+
+            // .ctor(IDbConnection connection, MappingSource mappingSource, IVendor mappingSource);
+            constructor = new CodeConstructor() {
+                Attributes = MemberAttributes.Public,
+                Parameters = {
+                    new CodeParameterDeclarationExpression("IDbConnection", "connection"),
+                    new CodeParameterDeclarationExpression("MappingSource", "mappingSource"),
+                    new CodeParameterDeclarationExpression("IVendor", "sqlDialect"),
+                },
+            };
+            constructor.BaseConstructorArgs.Add(new CodeArgumentReferenceExpression("connection"));
+            constructor.BaseConstructorArgs.Add(new CodeArgumentReferenceExpression("mappingSource"));
+            constructor.BaseConstructorArgs.Add(new CodeArgumentReferenceExpression("sqlDialect"));
+            constructor.Statements.Add(new CodeExpressionStatement(new CodeMethodInvokeExpression(thisReference, "OnCreated")));
+            contextType.Members.Add(constructor);
+
+            return contextType;
+        }
+        
+        void GenerateContextFunction(CodeTypeDeclaration contextType, Function function)
+        {
+            if (function == null || string.IsNullOrEmpty(function.Name))
+            {
+                Warning("L33 Invalid storedProcdure object: missing name.");
+                return;
+            }
+
+            var methodRetType = GetFunctionReturnType(function);
+            var method = new CodeMemberMethod() {
+                Attributes  = ToMemberAttributes(function),
+                Name        = function.Method ?? function.Name,
+                ReturnType  = methodRetType,
+                CustomAttributes = {
+                    new CodeAttributeDeclaration("Function",
+                        new CodeAttributeArgument("Name", new CodePrimitiveExpression(function.Name)),
+                        new CodeAttributeArgument("IsComposable", new CodePrimitiveExpression(function.IsComposable))),
+                },
+            };
+            if (method.Parameters != null)
+                method.Parameters.AddRange(function.Parameters.Select(x => GetFunctionParameterType(x)).ToArray());
+            if (function.Return != null && !string.IsNullOrEmpty(function.Return.DbType))
+                method.ReturnTypeCustomAttributes.Add(
+                        new CodeAttributeDeclaration("Parameter",
+                            new CodeAttributeArgument("DbType", new CodePrimitiveExpression(function.Return.DbType))));
+
+            contextType.Members.Add(method);
+
+            for (int i = 0; i < function.Parameters.Count; ++i)
+            {
+                var p = function.Parameters[i];
+                if (!p.DirectionOut)
+                    continue;
+                method.Statements.Add(
+                        new CodeAssignStatement(
+                            new CodeVariableReferenceExpression(p.Name),
+                            new CodeDefaultValueExpression(new CodeTypeReference(p.Type))));
+            }
+
+            var executeMethodCallArgs = new List<CodeExpression>() {
+                thisReference,
+                new CodeCastExpression(
+                    new CodeTypeReference("System.Reflection.MethodInfo"),
+                    new CodeMethodInvokeExpression(
+                        new CodeMethodReferenceExpression(
+                            new CodeTypeReferenceExpression("System.Reflection.MethodBase"), "GetCurrentMethod"))),
+            };
+            if (method.Parameters != null)
+                executeMethodCallArgs.AddRange(
+                        function.Parameters.Select(p => (CodeExpression) new CodeVariableReferenceExpression(p.Name)));
+            method.Statements.Add(
+                    new CodeVariableDeclarationStatement(
+                        new CodeTypeReference("IExecuteResult"),
+                        "result",
+                        new CodeMethodInvokeExpression(
+                            new CodeMethodReferenceExpression(thisReference, "ExecuteMethodCall"),
+                            executeMethodCallArgs.ToArray())));
+            for (int i = 0; i < function.Parameters.Count; ++i)
+            {
+                var p = function.Parameters[i];
+                if (!p.DirectionOut)
+                    continue;
+                method.Statements.Add(
+                        new CodeAssignStatement(
+                            new CodeVariableReferenceExpression(p.Name),
+                            new CodeCastExpression(
+                                new CodeTypeReference(p.Type),
+                                new CodeMethodInvokeExpression(
+                                    new CodeMethodReferenceExpression(
+                                        new CodeVariableReferenceExpression("result"),
+                                        "GetParameterValue"),
+                                    new CodePrimitiveExpression(i)))));
+            }
+
+            if (methodRetType != null)
+            {
+                method.Statements.Add(
+                        new CodeMethodReturnStatement(
+                            new CodeCastExpression(
+                                method.ReturnType,
+                                new CodePropertyReferenceExpression(
+                                    new CodeVariableReferenceExpression("result"),
+                                    "ReturnValue"))));
+            }
+        }
+
+        CodeTypeReference GetFunctionReturnType(Function function)
+        {
+            CodeTypeReference type = null;
+            if (function.Return != null)
+            {
+                type = GetFunctionType(function.Return.Type);
+            }
+
+            bool isDataShapeUnknown = function.ElementType == null
+                                      && function.BodyContainsSelectStatement
+                                      && !function.IsComposable;
+            if (isDataShapeUnknown)
+            {
+                //if we don't know the shape of results, and the proc body contains some selects,
+                //we have no choice but to return an untyped DataSet.
+                //
+                //TODO: either parse proc body like microsoft, 
+                //or create a little GUI tool which would call the proc with test values, to determine result shape.
+                type = new CodeTypeReference(typeof(DataSet));
+            }
+            return type;
+        }
+
+        static CodeTypeReference GetFunctionType(string type)
+        {
+            var t = System.Type.GetType(type);
+            if (t == null)
+                return new CodeTypeReference(type);
+            if (t.IsValueType)
+                return new CodeTypeReference(typeof(Nullable<>)) {
+                    TypeArguments = {
+                        new CodeTypeReference(t),
+                    },
+                };
+            return new CodeTypeReference(t);
+        }
+
+        CodeParameterDeclarationExpression GetFunctionParameterType(Parameter parameter)
+        {
+            var p = new CodeParameterDeclarationExpression(GetFunctionType(parameter.Type), parameter.Name) {
+                CustomAttributes = {
+                    new CodeAttributeDeclaration("Parameter",
+                        new CodeAttributeArgument("Name", new CodePrimitiveExpression(parameter.Name)),
+                        new CodeAttributeArgument("DbType", new CodePrimitiveExpression(parameter.DbType))),
+                },
+            };
+            switch (parameter.Direction)
+            {
+                case DbLinq.Schema.Dbml.ParameterDirection.In:
+                    p.Direction = FieldDirection.In;
+                    break;
+                case DbLinq.Schema.Dbml.ParameterDirection.Out:
+                    p.Direction = FieldDirection.Out;
+                    break;
+                case DbLinq.Schema.Dbml.ParameterDirection.InOut:
+                    p.Direction = FieldDirection.In | FieldDirection.Out;
+                    break;
+                default:
+                    throw new ArgumentOutOfRangeException();
+            }
+            return p;
+        }
+
+        protected CodeTypeDeclaration GenerateTableClass(Table table, Database database)
+        {
+            var _class = new CodeTypeDeclaration() {
+                IsClass         = true, 
+                IsPartial       = true, 
+                Name            = table.Type.Name, 
+                TypeAttributes  = TypeAttributes.Public,
+                CustomAttributes = {
+                    new CodeAttributeDeclaration("Table", 
+                        new CodeAttributeArgument("Name", new CodePrimitiveExpression(table.Name))),
+                },
+            };
+
+            WriteCustomTypes(_class, table);
+
+            var havePrimaryKeys = table.Type.Columns.Any(c => c.IsPrimaryKey);
+            if (havePrimaryKeys)
+            {
+                GenerateINotifyPropertyChanging(_class);
+                GenerateINotifyPropertyChanged(_class);
+            }
+
+            // Implement Constructor
+            var constructor = new CodeConstructor() { Attributes = MemberAttributes.Public };
+            // children are EntitySet
+            foreach (var child in GetClassChildren(table))
+            {
+                // if the association has a storage, we use it. Otherwise, we use the property name
+                var entitySetMember = GetStorageFieldName(child);
+                constructor.Statements.Add(
+                    new CodeAssignStatement(
+                        new CodeVariableReferenceExpression(entitySetMember),
+                        new CodeObjectCreateExpression(
+                            new CodeTypeReference("EntitySet", new CodeTypeReference(child.Type)),
+                            new CodeDelegateCreateExpression(
+                                new CodeTypeReference("Action", new CodeTypeReference(child.Type)),
+                                thisReference, child.Member + "_Attach"),
+                            new CodeDelegateCreateExpression(
+                                new CodeTypeReference("Action", new CodeTypeReference(child.Type)),
+                                thisReference, child.Member + "_Detach"))));
+            }
+            constructor.Statements.Add(new CodeExpressionStatement(new CodeMethodInvokeExpression(thisReference, "OnCreated")));
+            _class.Members.Add(constructor);
+
+            if (Context.Parameters.GenerateEqualsHash)
+            {
+                GenerateEntityGetHashCodeAndEquals(_class, table);
+            }
+
+            GenerateExtensibilityDeclarations(_class, table);
+
+            // todo: add these when the actually get called
+            //partial void OnLoaded();
+            //partial void OnValidate(System.Data.Linq.ChangeAction action);
+
+            // columns
+            foreach (Column column in table.Type.Columns)
+            {
+                var relatedAssociations = from a in table.Type.Associations
+                                          where a.IsForeignKey && a.TheseKeys.Contains(column.Name)
+                                          select a;
+
+                var type = ToCodeTypeReference(column);
+                var columnMember = column.Member ?? column.Name;
+
+                var field = new CodeMemberField(type, GetStorageFieldName(column));
+                _class.Members.Add(field);
+                var fieldReference = new CodeFieldReferenceExpression(new CodeThisReferenceExpression(), field.Name);
+
+                var onChanging  = GetChangingMethodName(columnMember);
+                var onChanged   = GetChangedMethodName(columnMember);
+
+                var property = new CodeMemberProperty();
+                property.Type = type;
+                property.Name = columnMember;
+                property.Attributes = MemberAttributes.Public | MemberAttributes.Final;
+
+                var defAttrValues = new ColumnAttribute();
+                var args = new List<CodeAttributeArgument>() {
+                    new CodeAttributeArgument("Storage", new CodePrimitiveExpression(GetStorageFieldName(column))),
+                    new CodeAttributeArgument("Name", new CodePrimitiveExpression(column.Name)),
+                    new CodeAttributeArgument("DbType", new CodePrimitiveExpression(column.DbType)),
+                };
+                if (defAttrValues.IsPrimaryKey != column.IsPrimaryKey)
+                    args.Add(new CodeAttributeArgument("IsPrimaryKey", new CodePrimitiveExpression(column.IsPrimaryKey)));
+                if (defAttrValues.IsDbGenerated != column.IsDbGenerated)
+                    args.Add(new CodeAttributeArgument("IsDbGenerated", new CodePrimitiveExpression(column.IsDbGenerated)));
+                if (column.AutoSync != DbLinq.Schema.Dbml.AutoSync.Default)
+                    args.Add(new CodeAttributeArgument("AutoSync", 
+                        new CodeFieldReferenceExpression(new CodeTypeReferenceExpression("AutoSync"), column.AutoSync.ToString())));
+                if (defAttrValues.CanBeNull != column.CanBeNull)
+                    args.Add(new CodeAttributeArgument("CanBeNull", new CodePrimitiveExpression(column.CanBeNull)));
+                if (column.Expression != null)
+                    args.Add(new CodeAttributeArgument("Expression", new CodePrimitiveExpression(column.Expression)));
+                property.CustomAttributes.Add(
+                    new CodeAttributeDeclaration("Column", args.ToArray()));
+                property.CustomAttributes.Add(new CodeAttributeDeclaration("DebuggerNonUserCode"));
+
+                property.GetStatements.Add(new CodeMethodReturnStatement(fieldReference));
+
+                var whenUpdating = new List<CodeStatement>(
+                    from assoc in relatedAssociations
+                    select (CodeStatement) new CodeConditionStatement(
+                        new CodePropertyReferenceExpression(
+                            new CodeVariableReferenceExpression(GetStorageFieldName(assoc)),
+                            "HasLoadedOrAssignedValue"),
+                        new CodeThrowExceptionStatement(
+                            new CodeObjectCreateExpression(typeof(System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException)))));
+                whenUpdating.Add(
+                        new CodeExpressionStatement(new CodeMethodInvokeExpression(thisReference, onChanging, new CodePropertySetValueReferenceExpression())));
+                if (havePrimaryKeys)
+                    whenUpdating.Add(
+                            new CodeExpressionStatement(new CodeMethodInvokeExpression(thisReference, "SendPropertyChanging")));
+                whenUpdating.Add(
+                        new CodeAssignStatement(fieldReference, new CodePropertySetValueReferenceExpression()));
+                if (havePrimaryKeys)
+                    whenUpdating.Add(
+                            new CodeExpressionStatement(new CodeMethodInvokeExpression(thisReference, "SendPropertyChanged", new CodePrimitiveExpression(property.Name))));
+                whenUpdating.Add(
+                        new CodeExpressionStatement(new CodeMethodInvokeExpression(thisReference, onChanged)));
+
+                var fieldType = TypeLoader.Load(column.Type);
+                // This is needed for VB.NET generation; 
+                // int/string/etc. can use '<>' for comparison, but NOT arrays and other reference types.
+                // arrays/etc. require the 'Is' operator, which is CodeBinaryOperatorType.IdentityEquality.
+                // The VB IsNot operator is not exposed from CodeDom.
+                // Thus, we need to special-case: if fieldType is a ref or nullable type,
+                //  generate '(field Is value) = false'; otherwise, 
+                //  generate '(field <> value)'
+                CodeBinaryOperatorExpression condition = fieldType.IsClass || fieldType.IsNullable()
+                    ? ValuesAreNotEqual_Ref(new CodeVariableReferenceExpression(field.Name), new CodePropertySetValueReferenceExpression())
+                    : ValuesAreNotEqual(new CodeVariableReferenceExpression(field.Name), new CodePropertySetValueReferenceExpression());
+                property.SetStatements.Add(new CodeConditionStatement(condition, whenUpdating.ToArray()));
+                _class.Members.Add(property);
+            }
+
+            GenerateEntityChildren(_class, table, database);
+            GenerateEntityChildrenAttachment(_class, table, database);
+            GenerateEntityParents(_class, table, database);
+
+            return _class;
+        }
+
+        void WriteCustomTypes(CodeTypeDeclaration entity, Table table)
+        {
+            // detect required custom types
+            foreach (var column in table.Type.Columns)
+            {
+                var extendedType = column.ExtendedType;
+                var enumType = extendedType as EnumType;
+                if (enumType != null)
+                {
+                    Context.ExtendedTypes[column] = new GenerationContext.ExtendedTypeAndName {
+                        Type = column.ExtendedType,
+                        Table = table
+                    };
+                }
+            }
+
+            var customTypesNames = new List<string>();
+
+            // create names and avoid conflits
+            foreach (var extendedTypePair in Context.ExtendedTypes)
+            {
+                if (extendedTypePair.Value.Table != table)
+                    continue;
+
+                if (string.IsNullOrEmpty(extendedTypePair.Value.Type.Name))
+                {
+                    string name = extendedTypePair.Key.Member + "Type";
+                    for (; ; )
+                    {
+                        if ((from t in Context.ExtendedTypes.Values where t.Type.Name == name select t).FirstOrDefault() == null)
+                        {
+                            extendedTypePair.Value.Type.Name = name;
+                            break;
+                        }
+                        // at 3rd loop, it will look ugly, however we will never go there
+                        name = extendedTypePair.Value.Table.Type.Name + name;
+                    }
+                }
+                customTypesNames.Add(extendedTypePair.Value.Type.Name);
+            }
+
+            // write custom types
+            if (customTypesNames.Count > 0)
+            {
+                var customTypes = new List<CodeTypeDeclaration>(customTypesNames.Count);
+
+                foreach (var extendedTypePair in Context.ExtendedTypes)
+                {
+                    if (extendedTypePair.Value.Table != table)
+                        continue;
+
+                    var extendedType = extendedTypePair.Value.Type;
+                    var enumValue = extendedType as EnumType;
+
+                    if (enumValue != null)
+                    {
+                        var enumType = new CodeTypeDeclaration(enumValue.Name) {
+                            TypeAttributes = TypeAttributes.Public,
+                            IsEnum = true,
+                        };
+                        customTypes.Add(enumType);
+                        var orderedValues = from nv in enumValue orderby nv.Value select nv;
+                        int currentValue = 1;
+                        foreach (var nameValue in orderedValues)
+                        {
+                            var field = new CodeMemberField() {
+                                Name = nameValue.Key,
+                            };
+                            enumType.Members.Add(field);
+                            if (nameValue.Value != currentValue)
+                            {
+                                currentValue = nameValue.Value;
+                                field.InitExpression = new CodePrimitiveExpression(nameValue.Value);
+                            }
+                            currentValue++;
+                        }
+                    }
+                }
+
+                if (customTypes.Count == 0)
+                    return;
+                customTypes.First().StartDirectives.Add(new CodeRegionDirective(CodeRegionMode.Start,
+                        string.Format("Custom type definitions for {0}", string.Join(", ", customTypesNames.ToArray()))));
+                customTypes.Last().EndDirectives.Add(new CodeRegionDirective(CodeRegionMode.End, null));
+                entity.Members.AddRange(customTypes.ToArray());
+            }
+        }
+
+        void GenerateExtensibilityDeclarations(CodeTypeDeclaration entity, Table table)
+        {
+            var partialMethods = new[] { CreatePartialMethod("OnCreated") }
+                .Concat(table.Type.Columns.Select(c => new[] { CreateChangedMethodDecl(c), CreateChangingMethodDecl(c) })
+                    .SelectMany(md => md)).ToArray();
+            partialMethods.First().StartDirectives.Add(new CodeRegionDirective(CodeRegionMode.Start, "Extensibility Method Declarations"));
+            partialMethods.Last().EndDirectives.Add(new CodeRegionDirective(CodeRegionMode.End, null));
+            entity.Members.AddRange(partialMethods);
+        }
+
+        static string GetChangedMethodName(string columnName)
+        {
+            return string.Format("On{0}Changed", columnName);
+        }
+
+        CodeTypeMember CreateChangedMethodDecl(Column column)
+        {
+            return CreatePartialMethod(GetChangedMethodName(column.Member));
+        }
+
+        static string GetChangingMethodName(string columnName)
+        {
+            return string.Format("On{0}Changing", columnName);
+        }
+
+        CodeTypeMember CreateChangingMethodDecl(Column column)
+        {
+            return CreatePartialMethod(GetChangingMethodName(column.Member),
+                    new CodeParameterDeclarationExpression(ToCodeTypeReference(column), "value"));
+        }
+
+        static CodeTypeReference ToCodeTypeReference(Column column)
+        {
+            var t = System.Type.GetType(column.Type);
+            if (t == null)
+                return new CodeTypeReference(column.Type);
+            return t.IsValueType && column.CanBeNull
+                ? new CodeTypeReference("System.Nullable", new CodeTypeReference(column.Type))
+                : new CodeTypeReference(column.Type);
+        }
+
+        CodeBinaryOperatorExpression ValuesAreNotEqual(CodeExpression a, CodeExpression b)
+        {
+            return new CodeBinaryOperatorExpression(a, CodeBinaryOperatorType.IdentityInequality, b);
+        }
+
+        CodeBinaryOperatorExpression ValuesAreNotEqual_Ref(CodeExpression a, CodeExpression b)
+        {
+            return new CodeBinaryOperatorExpression(
+                        new CodeBinaryOperatorExpression(
+                            a,
+                            CodeBinaryOperatorType.IdentityEquality,
+                            b),
+                        CodeBinaryOperatorType.ValueEquality,
+                        new CodePrimitiveExpression(false));
+        }
+
+        CodeBinaryOperatorExpression ValueIsNull(CodeExpression value)
+        {
+            return new CodeBinaryOperatorExpression(
+                value,
+                CodeBinaryOperatorType.IdentityEquality,
+                new CodePrimitiveExpression(null));
+        }
+
+        CodeBinaryOperatorExpression ValueIsNotNull(CodeExpression value)
+        {
+            return new CodeBinaryOperatorExpression(
+                value,
+                CodeBinaryOperatorType.IdentityInequality, 
+                new CodePrimitiveExpression(null));
+        }
+
+        static string GetStorageFieldName(Column column)
+        {
+            return GetStorageFieldName(column.Storage ?? column.Member);
+        }
+
+        static string GetStorageFieldName(string storage)
+        {
+            if (storage.StartsWith("_"))
+                return storage;
+            return "_" + storage;
+        }
+
+        private void GenerateINotifyPropertyChanging(CodeTypeDeclaration entity)
+        {
+            entity.BaseTypes.Add(typeof(INotifyPropertyChanging));
+            var propertyChangingEvent = new CodeMemberEvent() {
+                Attributes  = MemberAttributes.Public,
+                Name        = "PropertyChanging",
+                Type        = new CodeTypeReference(typeof(PropertyChangingEventHandler)),
+                ImplementationTypes = {
+                    new CodeTypeReference(typeof(INotifyPropertyChanging))
+                },
+            };
+            var eventArgs = new CodeMemberField(new CodeTypeReference(typeof(PropertyChangingEventArgs)), "emptyChangingEventArgs") {
+                Attributes      = MemberAttributes.Static | MemberAttributes.Private,
+                InitExpression  = new CodeObjectCreateExpression(new CodeTypeReference(typeof(PropertyChangingEventArgs)),
+                    new CodePrimitiveExpression("")),
+            };
+            var method = new CodeMemberMethod() {
+                Attributes  = MemberAttributes.Family,
+                Name        = "SendPropertyChanging",
+            };
+            method.Statements.Add(new CodeVariableDeclarationStatement(typeof(PropertyChangingEventHandler), "h") {
+                InitExpression  = new CodeEventReferenceExpression(thisReference, "PropertyChanging"),
+            });
+            method.Statements.Add(new CodeConditionStatement(
+                    ValueIsNotNull(new CodeVariableReferenceExpression("h")),
+                    new CodeExpressionStatement(
+                        new CodeDelegateInvokeExpression(new CodeVariableReferenceExpression("h"), thisReference, new CodeFieldReferenceExpression(null, "emptyChangingEventArgs")))));
+
+            entity.Members.Add(propertyChangingEvent);
+            entity.Members.Add(eventArgs);
+            entity.Members.Add(method);
+        }
+
+        private void GenerateINotifyPropertyChanged(CodeTypeDeclaration entity)
+        {
+            entity.BaseTypes.Add(typeof(INotifyPropertyChanged));
+
+            var propertyChangedEvent = new CodeMemberEvent() {
+                Attributes = MemberAttributes.Public,
+                Name = "PropertyChanged",
+                Type = new CodeTypeReference(typeof(PropertyChangedEventHandler)),
+                ImplementationTypes = {
+                    new CodeTypeReference(typeof(INotifyPropertyChanged))
+                },
+            };
+
+            var method = new CodeMemberMethod() { 
+                Attributes = MemberAttributes.Family, 
+                Name = "SendPropertyChanged", 
+                Parameters = { new CodeParameterDeclarationExpression(typeof(System.String), "propertyName") } 
+            };
+            method.Statements.Add(new CodeVariableDeclarationStatement(typeof(PropertyChangedEventHandler), "h") {
+                InitExpression = new CodeEventReferenceExpression(thisReference, "PropertyChanged"),
+            });
+            method.Statements.Add(new CodeConditionStatement(
+                    ValueIsNotNull(new CodeVariableReferenceExpression("h")),
+                    new CodeExpressionStatement(
+                        new CodeDelegateInvokeExpression(new CodeVariableReferenceExpression("h"), thisReference, new CodeObjectCreateExpression(typeof(PropertyChangedEventArgs), new CodeVariableReferenceExpression("propertyName"))))));
+
+            entity.Members.Add(propertyChangedEvent);
+            entity.Members.Add(method);
+        }
+
+        void GenerateEntityGetHashCodeAndEquals(CodeTypeDeclaration entity, Table table)
+        {
+            var primaryKeys = table.Type.Columns.Where(c => c.IsPrimaryKey);
+            var pkCount = primaryKeys.Count();
+            if (pkCount == 0)
+            {
+                Warning("Table {0} has no primary key(s).  Skipping /generate-equals-hash for this table.",
+                        table.Name);
+                return;
+            }
+            entity.BaseTypes.Add(new CodeTypeReference(typeof(IEquatable<>)) {
+                TypeArguments = { new CodeTypeReference(entity.Name) },
+            });
+
+            var method = new CodeMemberMethod() {
+                Attributes  = MemberAttributes.Public | MemberAttributes.Override,
+                Name        = "GetHashCode",
+                ReturnType  = new CodeTypeReference(typeof(int)),
+            };
+            entity.Members.Add(method);
+            method.Statements.Add(new CodeVariableDeclarationStatement(typeof(int), "hc", new CodePrimitiveExpression(0)));
+            var numShifts = 32 / pkCount;
+            int pki = 0;
+            foreach (var pk in primaryKeys)
+            {
+                var shift = 1 << (pki++ * numShifts);
+                // lack of exclusive-or means we instead split the 32-bit hash code value
+                // into pkCount "chunks", each chunk being numShifts in size.
+                // Thus, if there are two primary keys, the first primary key gets the
+                // lower 16 bits, while the second primray key gets the upper 16 bits.
+                CodeStatement update = new CodeAssignStatement(
+                        new CodeVariableReferenceExpression("hc"),
+                        new CodeBinaryOperatorExpression(
+                            new CodeVariableReferenceExpression("hc"),
+                            CodeBinaryOperatorType.BitwiseOr,
+                            new CodeBinaryOperatorExpression(
+                                new CodeMethodInvokeExpression(
+                                    new CodeMethodReferenceExpression(
+                                        new CodeVariableReferenceExpression(GetStorageFieldName(pk)),
+                                        "GetHashCode")),
+                                CodeBinaryOperatorType.Multiply,
+                                new CodePrimitiveExpression(shift))));
+                var pkType = System.Type.GetType(pk.Type);
+                if (pk.CanBeNull || (pkType != null && (pkType.IsClass || pkType.IsNullable())))
+                {
+                    update = new CodeConditionStatement(
+                            ValueIsNotNull(new CodeVariableReferenceExpression(GetStorageFieldName(pk))),
+                            update);
+                }
+                method.Statements.Add(update);
+            }
+            method.Statements.Add(new CodeMethodReturnStatement(new CodeVariableReferenceExpression("hc")));
+
+            method = new CodeMemberMethod() {
+                Attributes  = MemberAttributes.Public | MemberAttributes.Override,
+                Name        = "Equals",
+                ReturnType  = new CodeTypeReference(typeof(bool)),
+                Parameters = {
+                    new CodeParameterDeclarationExpression(new CodeTypeReference(typeof(object)), "value"),
+                },
+            };
+            entity.Members.Add(method);
+            method.Statements.Add(
+                    new CodeConditionStatement(
+                        ValueIsNull(new CodeVariableReferenceExpression("value")), 
+                        new CodeMethodReturnStatement(new CodePrimitiveExpression(false))));
+            method.Statements.Add(
+                    new CodeConditionStatement(
+                        ValuesAreNotEqual_Ref(
+                            new CodeMethodInvokeExpression(
+                                new CodeMethodReferenceExpression(
+                                    new CodeVariableReferenceExpression("value"),
+                                    "GetType")),
+                            new CodeMethodInvokeExpression(
+                                new CodeMethodReferenceExpression(thisReference, "GetType"))),
+                        new CodeMethodReturnStatement(new CodePrimitiveExpression(false))));
+            method.Statements.Add(
+                    new CodeVariableDeclarationStatement(
+                        new CodeTypeReference(entity.Name),
+                        "other",
+                        new CodeCastExpression(new CodeTypeReference(entity.Name), new CodeVariableReferenceExpression("value"))));
+            method.Statements.Add(
+                    new CodeMethodReturnStatement(
+                        new CodeMethodInvokeExpression(
+                            new CodeMethodReferenceExpression(thisReference, "Equals"),
+                            new CodeVariableReferenceExpression("other"))));
+
+            method = new CodeMemberMethod() {
+                Attributes  = MemberAttributes.Public,
+                Name        = "Equals",
+                ReturnType  = new CodeTypeReference(typeof(bool)),
+                Parameters  = {
+                    new CodeParameterDeclarationExpression(new CodeTypeReference(entity.Name), "value"),
+                },
+                ImplementationTypes = {
+                    new CodeTypeReference("IEquatable", new CodeTypeReference(entity.Name)),
+                },
+            };
+            entity.Members.Add(method);
+            method.Statements.Add(
+                    new CodeConditionStatement(
+                        ValueIsNull(new CodeVariableReferenceExpression("value")),
+                        new CodeMethodReturnStatement(new CodePrimitiveExpression(false))));
+
+            CodeExpression equals = null;
+            foreach (var pk in primaryKeys)
+            {
+                var compare = new CodeMethodInvokeExpression(
+                        new CodeMethodReferenceExpression(
+                            new CodePropertyReferenceExpression(
+                                new CodeTypeReferenceExpression(
+                                    new CodeTypeReference("System.Collections.Generic.EqualityComparer",
+                                        new CodeTypeReference(pk.Type))),
+                                "Default"),
+                            "Equals"),
+                        new CodeFieldReferenceExpression(thisReference, GetStorageFieldName(pk)),
+                        new CodeFieldReferenceExpression(new CodeVariableReferenceExpression("value"), GetStorageFieldName(pk)));
+                equals = equals == null
+                    ? (CodeExpression) compare
+                    : (CodeExpression) new CodeBinaryOperatorExpression(
+                        equals,
+                        CodeBinaryOperatorType.BooleanAnd,
+                        compare);
+            }
+            method.Statements.Add(
+                    new CodeMethodReturnStatement(equals));
+        }
+
+        void GenerateEntityChildren(CodeTypeDeclaration entity, Table table, Database schema)
+        {
+            var children = GetClassChildren(table);
+            if (children.Any())
+            {
+                var childMembers = new List<CodeTypeMember>();
+
+                foreach (var child in children)
+                {
+                    bool hasDuplicates = (from c in children where c.Member == child.Member select c).Count() > 1;
+
+                    // the following is apparently useless
+                    var targetTable = schema.Tables.FirstOrDefault(t => t.Type.Name == child.Type);
+                    if (targetTable == null)
+                    {
+                        //Logger.Write(Level.Error, "ERROR L143 target table class not found:" + child.Type);
+                        continue;
+                    }
+
+                    var childType = new CodeTypeReference("EntitySet", new CodeTypeReference(child.Type));
+                    var storage = GetStorageFieldName(child);
+                    entity.Members.Add(new CodeMemberField(childType, storage));
+
+                    var childName = hasDuplicates
+                        ? child.Member + "_" + string.Join("", child.OtherKeys.ToArray())
+                        : child.Member;
+                    var property = new CodeMemberProperty() {
+                        Name        = childName,
+                        Type        = childType,
+                        Attributes  = ToMemberAttributes(child),
+                        CustomAttributes = {
+                            new CodeAttributeDeclaration("Association",
+                                new CodeAttributeArgument("Storage", new CodePrimitiveExpression(GetStorageFieldName(child))),
+                                new CodeAttributeArgument("OtherKey", new CodePrimitiveExpression(child.OtherKey)),
+                                new CodeAttributeArgument("ThisKey", new CodePrimitiveExpression(child.ThisKey)),
+                                new CodeAttributeArgument("Name", new CodePrimitiveExpression(child.Name))),
+                            new CodeAttributeDeclaration("DebuggerNonUserCode"),
+                        },
+                    };
+                    childMembers.Add(property);
+                    property.GetStatements.Add(new CodeMethodReturnStatement(
+                            new CodeFieldReferenceExpression(thisReference, storage)));
+                    property.SetStatements.Add(new CodeAssignStatement(
+                            new CodeFieldReferenceExpression(thisReference, storage),
+                            new CodePropertySetValueReferenceExpression()));
+                }
+
+                if (childMembers.Count == 0)
+                    return;
+                childMembers.First().StartDirectives.Add(new CodeRegionDirective(CodeRegionMode.Start, "Children"));
+                childMembers.Last().EndDirectives.Add(new CodeRegionDirective(CodeRegionMode.End, null));
+                entity.Members.AddRange(childMembers.ToArray());
+            }
+        }
+
+        IEnumerable<Association> GetClassChildren(Table table)
+        {
+            return table.Type.Associations.Where(a => !a.IsForeignKey);
+        }
+
+        static MemberAttributes ToMemberAttributes(Association association)
+        {
+            MemberAttributes attrs = 0;
+            if (!association.AccessModifierSpecified)
+                attrs |= MemberAttributes.Public;
+            else
+                switch (association.AccessModifier)
+                {
+                    case AccessModifier.Internal:           attrs = MemberAttributes.Assembly; break;
+                    case AccessModifier.Private:            attrs = MemberAttributes.Private; break;
+                    case AccessModifier.Protected:          attrs = MemberAttributes.Family; break;
+                    case AccessModifier.ProtectedInternal:  attrs = MemberAttributes.FamilyOrAssembly; break;
+                    case AccessModifier.Public:             attrs = MemberAttributes.Public; break;
+                    default:
+                        throw new ArgumentOutOfRangeException("association", "Modifier value '" + association.AccessModifierSpecified + "' is an unsupported value.");
+                }
+            if (!association.ModifierSpecified)
+                attrs |= MemberAttributes.Final;
+            else
+                switch (association.Modifier)
+                {
+                    case MemberModifier.New:        attrs |= MemberAttributes.New | MemberAttributes.Final; break;
+                    case MemberModifier.NewVirtual: attrs |= MemberAttributes.New; break;
+                    case MemberModifier.Override:   attrs |= MemberAttributes.Override; break;
+                    case MemberModifier.Virtual:    break;
+                }
+            return attrs;
+        }
+
+        static MemberAttributes ToMemberAttributes(Function function)
+        {
+            MemberAttributes attrs = 0;
+            if (!function.AccessModifierSpecified)
+                attrs |= MemberAttributes.Public;
+            else
+                switch (function.AccessModifier)
+                {
+                    case AccessModifier.Internal:           attrs = MemberAttributes.Assembly; break;
+                    case AccessModifier.Private:            attrs = MemberAttributes.Private; break;
+                    case AccessModifier.Protected:          attrs = MemberAttributes.Family; break;
+                    case AccessModifier.ProtectedInternal:  attrs = MemberAttributes.FamilyOrAssembly; break;
+                    case AccessModifier.Public:             attrs = MemberAttributes.Public; break;
+                    default:
+                        throw new ArgumentOutOfRangeException("function", "Modifier value '" + function.AccessModifierSpecified + "' is an unsupported value.");
+                }
+            if (!function.ModifierSpecified)
+                attrs |= MemberAttributes.Final;
+            else
+                switch (function.Modifier)
+                {
+                    case MemberModifier.New:        attrs |= MemberAttributes.New | MemberAttributes.Final; break;
+                    case MemberModifier.NewVirtual: attrs |= MemberAttributes.New; break;
+                    case MemberModifier.Override:   attrs |= MemberAttributes.Override; break;
+                    case MemberModifier.Virtual:    break;
+                }
+            return attrs;
+        }
+
+        static string GetStorageFieldName(Association association)
+        {
+            return association.Storage != null 
+                ? GetStorageFieldName(association.Storage) 
+                : "_" + CreateIdentifier(association.Member ?? association.Name);
+        }
+
+        static string CreateIdentifier(string value)
+        {
+            return Regex.Replace(value, @"\W", "_");
+        }
+
+        void GenerateEntityChildrenAttachment(CodeTypeDeclaration entity, Table table, Database schema)
+        {
+            var children = GetClassChildren(table).ToList();
+            if (!children.Any())
+                return;
+
+            var havePrimaryKeys = table.Type.Columns.Any(c => c.IsPrimaryKey);
+
+            var handlers = new List<CodeTypeMember>();
+
+            foreach (var child in children)
+            {
+                // the reverse child is the association seen from the child
+                // we're going to use it...
+                var reverseChild = schema.GetReverseAssociation(child);
+                // ... to get the parent name
+                var memberName = reverseChild.Member;
+
+                var sendPropertyChanging = new CodeExpressionStatement(
+                        new CodeMethodInvokeExpression(
+                            new CodeMethodReferenceExpression(thisReference, "SendPropertyChanging")));
+
+                var attach = new CodeMemberMethod() {
+                    Name = child.Member + "_Attach",
+                    Parameters = {
+                        new CodeParameterDeclarationExpression(child.Type, "entity"),
+                    },
+                };
+                handlers.Add(attach);
+                if (havePrimaryKeys)
+                    attach.Statements.Add(sendPropertyChanging);
+                attach.Statements.Add(
+                        new CodeAssignStatement(
+                            new CodePropertyReferenceExpression(new CodeVariableReferenceExpression("entity"), memberName),
+                            thisReference));
+
+                var detach = new CodeMemberMethod() {
+                    Name = child.Member + "_Detach",
+                    Parameters = {
+                        new CodeParameterDeclarationExpression(child.Type, "entity"),
+                    },
+                };
+                handlers.Add(detach);
+                if (havePrimaryKeys)
+                    detach.Statements.Add(sendPropertyChanging);
+                detach.Statements.Add(
+                        new CodeAssignStatement(
+