Browse Source

Some .net 4.0 api compatibility fixes

Marek Safar 15 years ago
parent
commit
bd05c6c836
23 changed files with 172 additions and 99 deletions
  1. 13 18
      mcs/class/System.Core/System.Collections.Generic/HashSet.cs
  2. 1 3
      mcs/class/System.Core/System.IO.MemoryMappedFiles/MemoryMappedFileRights.cs
  3. 33 2
      mcs/class/System.Core/System.IO.MemoryMappedFiles/MemoryMappedFileSecurity.cs
  4. 12 12
      mcs/class/System.Core/System.Linq/Enumerable.cs
  5. 9 14
      mcs/class/System.Core/System.Linq/EnumerableQuery_T.cs
  6. 3 2
      mcs/class/System.Core/System.Linq/IOrderedEnumerable_T.cs
  7. 3 3
      mcs/class/System.Core/System.Linq/Lookup.cs
  8. 3 3
      mcs/class/System.Core/System/TimeZoneInfo.TransitionTime.cs
  9. 7 7
      mcs/class/System.Numerics/System.Numerics/Complex.cs
  10. 1 1
      mcs/class/corlib/Microsoft.Win32/RegistryValueKind.cs
  11. 3 0
      mcs/class/corlib/System.Collections.Concurrent/ConcurrentDictionary.cs
  12. 3 2
      mcs/class/corlib/System.IO.IsolatedStorage/IsolatedStorageSecurityOptions.cs
  13. 5 13
      mcs/class/corlib/System.Reflection/Assembly.cs
  14. 0 2
      mcs/class/corlib/System.Resources/ResourceManager.cs
  15. 3 0
      mcs/class/corlib/System.Runtime.InteropServices/TypeLibImporterFlags.cs
  16. 31 2
      mcs/class/corlib/System.Security.AccessControl/ObjectSecurity_T.cs
  17. 12 0
      mcs/class/corlib/System.Security.Permissions/SecurityAction.cs
  18. 10 9
      mcs/class/corlib/System/AggregateException.cs
  19. 2 2
      mcs/class/corlib/System/AppDomain.cs
  20. 10 0
      mcs/class/corlib/System/Decimal.cs
  21. 2 2
      mcs/class/corlib/System/InvalidTimeZoneException.cs
  22. 4 0
      mcs/class/corlib/System/String.cs
  23. 2 2
      mcs/class/corlib/System/TimeZoneNotFoundException.cs

+ 13 - 18
mcs/class/System.Core/System.Collections.Generic/HashSet.cs

@@ -176,26 +176,26 @@ namespace System.Collections.Generic {
 		{
 			CopyTo (array, 0, count);
 		}
-
-		public void CopyTo (T [] array, int index)
+		
+		public void CopyTo (T [] array, int arrayIndex)
 		{
-			CopyTo (array, index, count);
+			CopyTo (array, arrayIndex, count);
 		}
 
-		public void CopyTo (T [] array, int index, int count)
+		public void CopyTo (T [] array, int arrayIndex, int count)
 		{
 			if (array == null)
 				throw new ArgumentNullException ("array");
-			if (index < 0)
-				throw new ArgumentOutOfRangeException ("index");
-			if (index > array.Length)
+			if (arrayIndex < 0)
+				throw new ArgumentOutOfRangeException ("arrayIndex");
+			if (arrayIndex > array.Length)
 				throw new ArgumentException ("index larger than largest valid index of array");
-			if (array.Length - index < count)
+			if (array.Length - arrayIndex < count)
 				throw new ArgumentException ("Destination array cannot hold the requested elements!");
 
 			for (int i = 0, items = 0; i < touched && items < count; i++) {
 				if (GetLinkHashCode (i) != 0)
-					array [index++] = slots [i];
+					array [arrayIndex++] = slots [i];
 			}
 		}
 
@@ -352,15 +352,15 @@ namespace System.Collections.Generic {
 			return true;
 		}
 
-		public int RemoveWhere (Predicate<T> predicate)
+		public int RemoveWhere (Predicate<T> match)
 		{
-			if (predicate == null)
-				throw new ArgumentNullException ("predicate");
+			if (match == null)
+				throw new ArgumentNullException ("match");
 
 			var candidates = new List<T> ();
 
 			foreach (var item in this)
-				if (predicate (item)) 
+				if (match (item)) 
 					candidates.Add (item);
 
 			foreach (var item in candidates)
@@ -597,11 +597,6 @@ namespace System.Collections.Generic {
 			get { return false; }
 		}
 
-		void ICollection<T>.CopyTo (T [] array, int index)
-		{
-			CopyTo (array, index);
-		}
-
 		void ICollection<T>.Add (T item)
 		{
 			Add (item);

+ 1 - 3
mcs/class/System.Core/System.IO.MemoryMappedFiles/MemoryMappedFileRights.cs

@@ -35,7 +35,6 @@ namespace System.IO.MemoryMappedFiles
 {
 	[Flags]
 	public enum MemoryMappedFileRights {
-		None = 0,
 		CopyOnWrite = 1,
 		Write = 2,
 		Read  = 4,
@@ -48,8 +47,7 @@ namespace System.IO.MemoryMappedFiles
 		ChangePermissions = 0x40000,
 		TakeOwnership = 0x80000,
 		FullControl = 0xf000f,
-		AccessSystemSecurity = 0x1000000,
-		DelayAllocatePages = 0x4000000
+		AccessSystemSecurity = 0x1000000
 	}
 }
 

+ 33 - 2
mcs/class/System.Core/System.IO.MemoryMappedFiles/MemoryMappedFileSecurity.cs

@@ -1,8 +1,39 @@
+//
+// MemoryMappedFileSecurity.cs
+//
+// Authors:
+//	Marek Safar ([email protected])
+//
+// Copyright (C) 2009, 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_4_0
 
-namespace System.IO.MemoryMappedFiles {
+using System.Security.AccessControl;
 
-	public class MemoryMappedFileSecurity {
+namespace System.IO.MemoryMappedFiles
+{
+	public class MemoryMappedFileSecurity : ObjectSecurity<MemoryMappedFileRights>
+	{
 	}
 }
 

+ 12 - 12
mcs/class/System.Core/System.Linq/Enumerable.cs

@@ -642,13 +642,13 @@ namespace System.Linq
 			return counter;
 		}
 
-		public static int Count<TSource> (this IEnumerable<TSource> source, Func<TSource, bool> selector)
+		public static int Count<TSource> (this IEnumerable<TSource> source, Func<TSource, bool> predicate)
 		{
-			Check.SourceAndSelector (source, selector);
+			Check.SourceAndSelector (source, predicate);
 
 			int counter = 0;
 			foreach (var element in source)
-				if (selector (element))
+				if (predicate (element))
 					counter++;
 
 			return counter;
@@ -1262,13 +1262,13 @@ namespace System.Linq
 			return counter;
 		}
 
-		public static long LongCount<TSource> (this IEnumerable<TSource> source, Func<TSource, bool> selector)
+		public static long LongCount<TSource> (this IEnumerable<TSource> source, Func<TSource, bool> predicate)
 		{
-			Check.SourceAndSelector (source, selector);
+			Check.SourceAndSelector (source, predicate);
 
 			long counter = 0;
 			foreach (TSource element in source)
-				if (selector (element))
+				if (predicate (element))
 					counter++;
 
 			return counter;
@@ -2285,11 +2285,11 @@ namespace System.Linq
 		}
 
 		public static IEnumerable<TResult> SelectMany<TSource, TCollection, TResult> (this IEnumerable<TSource> source,
-			Func<TSource, IEnumerable<TCollection>> collectionSelector, Func<TSource, TCollection, TResult> selector)
+			Func<TSource, IEnumerable<TCollection>> collectionSelector, Func<TSource, TCollection, TResult> resultSelector)
 		{
-			Check.SourceAndCollectionSelectors (source, collectionSelector, selector);
+			Check.SourceAndCollectionSelectors (source, collectionSelector, resultSelector);
 
-			return CreateSelectManyIterator (source, collectionSelector, selector);
+			return CreateSelectManyIterator (source, collectionSelector, resultSelector);
 		}
 
 		static IEnumerable<TResult> CreateSelectManyIterator<TSource, TCollection, TResult> (IEnumerable<TSource> source,
@@ -2301,11 +2301,11 @@ namespace System.Linq
 		}
 
 		public static IEnumerable<TResult> SelectMany<TSource, TCollection, TResult> (this IEnumerable<TSource> source,
-			Func<TSource, int, IEnumerable<TCollection>> collectionSelector, Func<TSource, TCollection, TResult> selector)
+			Func<TSource, int, IEnumerable<TCollection>> collectionSelector, Func<TSource, TCollection, TResult> resultSelector)
 		{
-			Check.SourceAndCollectionSelectors (source, collectionSelector, selector);
+			Check.SourceAndCollectionSelectors (source, collectionSelector, resultSelector);
 
-			return CreateSelectManyIterator (source, collectionSelector, selector);
+			return CreateSelectManyIterator (source, collectionSelector, resultSelector);
 		}
 
 		static IEnumerable<TResult> CreateSelectManyIterator<TSource, TCollection, TResult> (IEnumerable<TSource> source,

+ 9 - 14
mcs/class/System.Core/System.Linq/EnumerableQuery_T.cs

@@ -37,17 +37,17 @@ namespace System.Linq
 {
 	public class EnumerableQuery<T> : EnumerableQuery, IOrderedQueryable<T>, IQueryable<T>, IQueryProvider
 	{
-		QueryableEnumerable<T> queryable;
+		readonly QueryableEnumerable<T> queryable;
 
-		public Type ElementType {
+		Type IQueryable.ElementType {
 			get { return queryable.ElementType; }
 		}
 
-		public Expression Expression {
+		Expression IQueryable.Expression {
 			get { return queryable.Expression; }
 		}
 
-		public IQueryProvider Provider {
+		IQueryProvider IQueryable.Provider {
 			get { return queryable; }
 		}
 
@@ -61,37 +61,32 @@ namespace System.Linq
 			queryable = new QueryableEnumerable<T> (enumerable);
 		}
 
-		public IEnumerable GetEnumerable ()
-		{
-			return queryable.GetEnumerable ();
-		}
-
 		IEnumerator IEnumerable.GetEnumerator ()
 		{
 			return queryable.GetEnumerator ();
 		}
 
-		public IEnumerator<T> GetEnumerator ()
+		IEnumerator<T> IEnumerable<T>.GetEnumerator ()
 		{
 			return queryable.GetEnumerator ();
 		}
 
-		public IQueryable CreateQuery (Expression expression)
+		IQueryable IQueryProvider.CreateQuery (Expression expression)
 		{
 			return queryable.CreateQuery (expression);
 		}
 
-		public object Execute (Expression expression)
+		object IQueryProvider.Execute (Expression expression)
 		{
 			return queryable.Execute (expression);
 		}
 
-		public IQueryable<TElem> CreateQuery<TElem> (Expression expression)
+		IQueryable<TElem> IQueryProvider.CreateQuery<TElem> (Expression expression)
 		{
 			return new EnumerableQuery<TElem> (expression);
 		}
 
-		public TResult Execute<TResult> (Expression expression)
+		TResult IQueryProvider.Execute<TResult> (Expression expression)
 		{
 			return queryable.Execute<TResult> (expression);
 		}

+ 3 - 2
mcs/class/System.Core/System.Linq/IOrderedEnumerable_T.cs

@@ -30,7 +30,8 @@ using System.Collections.Generic;
 
 namespace System.Linq {
 
-	public interface IOrderedEnumerable<TElement> : IEnumerable<TElement> {
-		IOrderedEnumerable<TElement> CreateOrderedEnumerable<TKey> (Func<TElement, TKey> selector, IComparer<TKey> comparer, bool descending);
+	public interface IOrderedEnumerable<TElement> : IEnumerable<TElement>
+	{
+		IOrderedEnumerable<TElement> CreateOrderedEnumerable<TKey> (Func<TElement, TKey> keySelector, IComparer<TKey> comparer, bool descending);
 	}
 }

+ 3 - 3
mcs/class/System.Core/System.Linq/Lookup.cs

@@ -69,13 +69,13 @@ namespace System.Linq {
 				nullGrouping = new Grouping<TKey, TElement> (default (TKey), nullKeyElements);
 		}
 
-		public IEnumerable<TResult> ApplyResultSelector<TResult> (Func<TKey, IEnumerable<TElement>, TResult> selector)
+		public IEnumerable<TResult> ApplyResultSelector<TResult> (Func<TKey, IEnumerable<TElement>, TResult> resultSelector)
 		{
 			if (nullGrouping != null)
-				yield return selector (nullGrouping.Key, nullGrouping);
+				yield return resultSelector (nullGrouping.Key, nullGrouping);
 			
 			foreach (var group in groups.Values)
-				yield return selector (group.Key, group);
+				yield return resultSelector (group.Key, group);
 		}
 
 		public bool Contains (TKey key)

+ 3 - 3
mcs/class/System.Core/System/TimeZoneInfo.TransitionTime.cs

@@ -193,10 +193,10 @@ namespace System
 				throw new NotImplementedException ();
 			}
 	
-			public override bool Equals (object other)
+			public override bool Equals (object obj)
 			{
-				if (other is TransitionTime)
-					return this == (TransitionTime) other;
+				if (obj is TransitionTime)
+					return this == (TransitionTime) obj;
 				return false;
 			}
 

+ 7 - 7
mcs/class/System.Numerics/System.Numerics/Complex.cs

@@ -110,13 +110,13 @@ namespace System.Numerics {
 				(left.imaginary * right.real - left.real * right.imaginary) / rsri);
 		}
 
-		public static Complex Divide (Complex left, Complex right)
+		public static Complex Divide (Complex dividend, Complex divisor)
 		{
-			double rsri = right.real * right.real + right.imaginary * right.imaginary;
+			double rsri = divisor.real * divisor.real + divisor.imaginary * divisor.imaginary;
 			return new Complex (
-				(left.real * right.real + left.imaginary * right.imaginary) / rsri,
+				(dividend.real * divisor.real + dividend.imaginary * divisor.imaginary) / rsri,
 
-				(left.imaginary * right.real - left.real * right.imaginary) / rsri);
+				(dividend.imaginary * divisor.real - dividend.real * divisor.imaginary) / rsri);
 		}
 
 		public static bool operator == (Complex left, Complex right)
@@ -129,12 +129,12 @@ namespace System.Numerics {
 			return real == value.real && imaginary == value.imaginary;
 		}
 
-		public override bool Equals (object value)
+		public override bool Equals (object obj)
 		{
-			if (value == null || !(value is Complex))
+			if (obj == null || !(obj is Complex))
 				return false;
 
-			Complex r = (Complex) value;
+			Complex r = (Complex) obj;
 			return real == r.real && imaginary == r.imaginary;
 		}
 		

+ 1 - 1
mcs/class/corlib/Microsoft.Win32/RegistryValueKind.cs

@@ -41,7 +41,7 @@ namespace Microsoft.Win32
 		MultiString = 7,
 		QWord = 11,
 #if NET_4_0
-		None = 12
+		None = -1
 #endif
 	}
 }

+ 3 - 0
mcs/class/corlib/System.Collections.Concurrent/ConcurrentDictionary.cs

@@ -29,9 +29,12 @@ using System.Threading;
 using System.Collections;
 using System.Collections.Generic;
 using System.Runtime.Serialization;
+using System.Diagnostics;
 
 namespace System.Collections.Concurrent
 {
+	[DebuggerDisplay ("Count={Count}")]
+	[DebuggerTypeProxy (typeof (CollectionDebuggerView<,>))]
 	public class ConcurrentDictionary<TKey, TValue> : IDictionary<TKey, TValue>,
 	  ICollection<KeyValuePair<TKey, TValue>>, IEnumerable<KeyValuePair<TKey, TValue>>,
 	  IDictionary, ICollection, IEnumerable

+ 3 - 2
mcs/class/corlib/System.IO.IsolatedStorage/IsolatedStorageSecurityOptions.cs

@@ -29,8 +29,9 @@
 #if NET_4_0
 namespace System.IO.IsolatedStorage
 {
-	public enum IsolatedStorageSecurityOptions {
-		IncreaseQuotaForApplication
+	public enum IsolatedStorageSecurityOptions
+	{
+		IncreaseQuotaForApplication = 4
 	}
 }
 

+ 5 - 13
mcs/class/corlib/System.Reflection/Assembly.cs

@@ -45,8 +45,6 @@ using Mono.Security;
 
 namespace System.Reflection {
 
-#pragma warning disable 659 // overrides Equals but not GetHashCode
-
 	[ComVisible (true)]
 	[ComDefaultInterfaceAttribute (typeof (_Assembly))]
 	[Serializable]
@@ -597,9 +595,7 @@ namespace System.Reflection {
 			return LoadFrom (assemblyFile, true);
 		}
 
-#if NET_4_0
 		[Obsolete]
-#endif
 		public static Assembly LoadWithPartialName (string partialName)
 		{
 			return LoadWithPartialName (partialName, null);
@@ -624,9 +620,7 @@ namespace System.Reflection {
 		[MethodImplAttribute (MethodImplOptions.InternalCall)]
 		private static extern Assembly load_with_partial_name (string name, Evidence e);
 
-#if NET_4_0
 		[Obsolete]
-#endif
 		public static Assembly LoadWithPartialName (string partialName, Evidence securityEvidence)
 		{
 			return LoadWithPartialName (partialName, securityEvidence, true);
@@ -780,6 +774,11 @@ namespace System.Reflection {
 			[MethodImplAttribute (MethodImplOptions.InternalCall)]
 			get;
 		}
+		
+		public override int GetHashCode ()
+		{
+			return base.GetHashCode ();
+		}
 
 		public override bool Equals (object o)
 		{
@@ -946,11 +945,6 @@ namespace System.Reflection {
 			get { return false; }
 		}
 
-		public override int GetHashCode ()
-		{
-			return base.GetHashCode ();
-		}
-
 		public static bool operator == (Assembly left, Assembly right)
 		{
 			if ((object)left == (object)right)
@@ -971,5 +965,3 @@ namespace System.Reflection {
 #endif
 	}
 }
-
-#pragma warning restore 659

+ 0 - 2
mcs/class/corlib/System.Resources/ResourceManager.cs

@@ -302,14 +302,12 @@ namespace System.Resources
 			return null;
 		}
 
-		[CLSCompliant (false)]
 		[ComVisible (false)]
 		public UnmanagedMemoryStream GetStream (string name)
 		{
 			return GetStream (name, (CultureInfo) null);
 		}
 
-		[CLSCompliant (false)]
 		[ComVisible (false)]
 		public UnmanagedMemoryStream GetStream (string name, CultureInfo culture)
 		{

+ 3 - 0
mcs/class/corlib/System.Runtime.InteropServices/TypeLibImporterFlags.cs

@@ -48,5 +48,8 @@ namespace System.Runtime.InteropServices
 		ImportAsX86 = 256,
 		ReflectionOnlyLoading = 4096,
 		SerializableValueClasses = 32,
+#if NET_4_0
+		NoDefineVersionResource = 8192
+#endif
 	}
 }

+ 31 - 2
mcs/class/corlib/System.Security.AccessControl/ObjectSecurity_T.cs

@@ -23,12 +23,41 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if NET_4_0
+#if NET_4_0 || BOOTSTRAP_NET_4_0
+
+using System.Security.Principal;
 
 namespace System.Security.AccessControl
 {
-	public abstract class ObjectSecurity<T> : NativeObjectSecurity
+	public abstract class ObjectSecurity<T> : NativeObjectSecurity where T : struct
 	{
+		public override Type AccessRightType {
+			get {
+				return null;
+			}
+		}
+		
+		public override Type AccessRuleType {
+			get {
+				return null;
+			}
+		}
+		
+		public override Type AuditRuleType {
+			get {
+				return null;
+			}
+		}
+		
+		public override AccessRule AccessRuleFactory(IdentityReference identityReference, int accessMask, bool isInherited, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags, AccessControlType type)
+		{
+			return null;
+		}
+		
+		public override AuditRule AuditRuleFactory(IdentityReference identityReference, int accessMask, bool isInherited, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags, AuditFlags flags)
+		{
+			return null;
+		}
 	}
 }
 	

+ 12 - 0
mcs/class/corlib/System.Security.Permissions/SecurityAction.cs

@@ -43,12 +43,24 @@ namespace System.Security.Permissions {
 	public enum SecurityAction {
 		Demand = 2,
 		Assert = 3,
+#if NET_4_0
+		[Obsolete]
+#endif
 		Deny = 4,
 		PermitOnly = 5,
 		LinkDemand = 6,
 		InheritanceDemand = 7,
+#if NET_4_0
+		[Obsolete]
+#endif
 		RequestMinimum = 8,
+#if NET_4_0
+		[Obsolete]
+#endif
 		RequestOptional = 9,
+#if NET_4_0
+		[Obsolete]
+#endif
 		RequestRefuse = 10,
 	}
 }

+ 10 - 9
mcs/class/corlib/System/AggregateException.cs

@@ -43,12 +43,12 @@ namespace System
 		{
 		}
 		
-		public AggregateException (string message, Exception e): base (message, e)
+		public AggregateException (string message, Exception innerException): base (message, innerException)
 		{
 		}
 		
-		protected AggregateException (SerializationInfo info, StreamingContext ctx)
-			: base (info, ctx)
+		protected AggregateException (SerializationInfo info, StreamingContext context)
+			: base (info, context)
 		{
 		}
 		
@@ -67,10 +67,10 @@ namespace System
 		{
 		}
 		
-		public AggregateException (string message, IEnumerable<Exception> inner)
-			: base(GetFormattedMessage(message, inner))
+		public AggregateException (string message, IEnumerable<Exception> innerExceptions)
+			: base(GetFormattedMessage(message, innerExceptions))
 		{
-			this.innerExceptions = new List<Exception> (inner);
+			this.innerExceptions = new List<Exception> (innerExceptions);
 		}
 		
 		public AggregateException Flatten ()
@@ -89,12 +89,12 @@ namespace System
 			return new AggregateException (inner);
 		}
 		
-		public void Handle (Func<Exception, bool> handler)
+		public void Handle (Func<Exception, bool> predicate)
 		{
 			List<Exception> failed = new List<Exception> ();
 			foreach (var e in innerExceptions) {
 				try {
-					if (!handler (e))
+					if (!predicate (e))
 						failed.Add (e);
 				} catch {
 					throw new AggregateException (failed);
@@ -115,9 +115,10 @@ namespace System
 			return this.Message;
 		}
 		
-		const string baseMessage = "Exception(s) occurred : {0}.";
 		static string GetFormattedMessage (string customMessage, IEnumerable<Exception> inner)
 		{
+			const string baseMessage = "Exception(s) occurred : {0}.";
+			
 			System.Text.StringBuilder finalMessage
 				= new System.Text.StringBuilder (string.Format (baseMessage, customMessage));
 			foreach (Exception e in inner) {

+ 2 - 2
mcs/class/corlib/System/AppDomain.cs

@@ -390,11 +390,11 @@ namespace System {
 			                                     culture, activationAttributes, null);
 		}
 
-		public object CreateInstanceFromAndUnwrap (string assemblyName, string typeName, bool ignoreCase,
+		public object CreateInstanceFromAndUnwrap (string assemblyFile, string typeName, bool ignoreCase,
 		                                           BindingFlags bindingAttr, Binder binder, object[] args,
 		                                           CultureInfo culture, object[] activationAttributes)
 		{
-			ObjectHandle oh = CreateInstanceFrom (assemblyName, typeName, ignoreCase, bindingAttr, binder, args,
+			ObjectHandle oh = CreateInstanceFrom (assemblyFile, typeName, ignoreCase, bindingAttr, binder, args,
 				culture, activationAttributes);
 
 			return (oh != null) ? oh.Unwrap () : null;

+ 10 - 0
mcs/class/corlib/System/Decimal.cs

@@ -38,6 +38,7 @@ using System.Globalization;
 using System.Text;
 using System.Runtime.CompilerServices;
 using System.Runtime.ConstrainedExecution;
+using System.Runtime.Serialization;
 
 #if MSTEST
 using System.Runtime.InteropServices;
@@ -53,6 +54,9 @@ namespace System
 	[Serializable]
 	[System.Runtime.InteropServices.ComVisible (true)]
 	public struct Decimal: IFormattable, IConvertible, IComparable, IComparable<Decimal>, IEquatable <Decimal>
+#if NET_4_0
+		, IDeserializationCallback
+#endif
 	{
 		public const decimal MinValue = -79228162514264337593543950335m;
 		public const decimal MaxValue =  79228162514264337593543950335m;
@@ -1336,6 +1340,12 @@ namespace System
 		{
 			return ToString ("G", provider);
 		}
+		
+#if NET_4_0
+		void IDeserializationCallback.OnDeserialization(object sender)
+		{
+		}
+#endif
 
 #if !MSTEST
 		[MethodImplAttribute(MethodImplOptions.InternalCall)]

+ 2 - 2
mcs/class/corlib/System/InvalidTimeZoneException.cs

@@ -44,10 +44,10 @@ namespace System
 		public InvalidTimeZoneException (string message) : base (message)
 		{}
 
-		public InvalidTimeZoneException (string message, Exception e) : base (message, e)
+		public InvalidTimeZoneException (string message, Exception innerException) : base (message, innerException)
 		{}
 
-		protected InvalidTimeZoneException (Runtime.Serialization.SerializationInfo info, Runtime.Serialization.StreamingContext sc) : base (info, sc)
+		protected InvalidTimeZoneException (Runtime.Serialization.SerializationInfo info, Runtime.Serialization.StreamingContext context) : base (info, context)
 		{}
 	}
 }

+ 4 - 0
mcs/class/corlib/System/String.cs

@@ -2217,7 +2217,11 @@ namespace System
 			return InternalIsInterned (str);
 		}
 	
+#if NET_4_0
 		public static string Join (string separator, params string [] value)
+#else
+		public static string Join (string separator, string [] value)
+#endif
 		{
 			if (value == null)
 				throw new ArgumentNullException ("value");

+ 2 - 2
mcs/class/corlib/System/TimeZoneNotFoundException.cs

@@ -44,10 +44,10 @@ namespace System
 		public TimeZoneNotFoundException (string message) : base (message)
 		{}
 
-		public TimeZoneNotFoundException (string message, Exception e) : base (message, e)
+		public TimeZoneNotFoundException (string message, Exception innerException) : base (message, innerException)
 		{}
 
-		protected TimeZoneNotFoundException (Runtime.Serialization.SerializationInfo info, Runtime.Serialization.StreamingContext sc) : base (info, sc)
+		protected TimeZoneNotFoundException (Runtime.Serialization.SerializationInfo info, Runtime.Serialization.StreamingContext context) : base (info, context)
 		{}
 	}
 }