Explorar o código

2003-11-25 Zoltan Varga <[email protected]>

	* Assembly.cs (LoadWithPartialName): Return null instead of throwing
	an exception to match MS behavior.

svn path=/trunk/mcs/; revision=20427
Zoltan Varga %!s(int64=22) %!d(string=hai) anos
pai
achega
41ff2aed1c

+ 8 - 2
mcs/class/corlib/System.Reflection/Assembly.cs

@@ -356,10 +356,16 @@ namespace System.Reflection {
 		[MonoTODO]
 		public static Assembly LoadWithPartialName (string partialName, Evidence securityEvidence)
 		{
-			return AppDomain.CurrentDomain.Load (partialName, securityEvidence);
+			try {
+				return AppDomain.CurrentDomain.Load (partialName, securityEvidence);
+			}
+			catch (Exception ex) {
+				// According to MSDN, this should return null instead of
+				// throwing an exception
+				return null;
+			}
 		}
 
-
 		public Object CreateInstance (String typeName) 
 		{
 			return CreateInstance (typeName, false);

+ 5 - 0
mcs/class/corlib/System.Reflection/ChangeLog

@@ -1,3 +1,8 @@
+2003-11-25  Zoltan Varga  <[email protected]>
+
+	* Assembly.cs (LoadWithPartialName): Return null instead of throwing
+	an exception to match MS behavior.
+
 2003-11-24  Zoltan Varga  <[email protected]>
 
 	* MonoMethod.cs: Add missing constructor.