Browse Source

2003-10-17 Zoltan Varga <[email protected]>

	* AssemblyName.cs: Fix Version property when some version fields are
	undefined.

svn path=/trunk/mcs/; revision=19129
Zoltan Varga 22 years ago
parent
commit
bd75209320

+ 8 - 1
mcs/class/corlib/System.Reflection/AssemblyName.cs

@@ -16,6 +16,7 @@ using System.Reflection;
 using System.Runtime.Serialization;
 using System.Security.Cryptography;
 using System.Text;
+using System.Runtime.InteropServices;
 
 namespace System.Reflection {
 
@@ -117,7 +118,13 @@ namespace System.Reflection {
 			get {
 				if (name == null)
 					return null;
-				return new Version (major, minor, build, revision);
+				if (build == -1)
+					return new Version (major, minor);
+				else
+					if (revision == -1)
+						return new Version (major, minor, build);
+				else
+					return new Version (major, minor, build, revision);
 			}
 
 			set {

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

@@ -1,3 +1,8 @@
+2003-10-17  Zoltan Varga  <[email protected]>
+
+	* AssemblyName.cs: Fix Version property when some version fields are
+	undefined.
+
 2003-10-17  Martin Baulig  <[email protected]>
 
 	* MethodInfo.cs (MethodInfo.GetGenericArguments): New method.
@@ -582,4 +587,3 @@ Thu Sep 13 18:05:16 CEST 2001 Paolo Molaro <[email protected]>
 2001-07-18  Michael Lambert <[email protected]>
 
 	* BindingFlags.cs: Add.
->>>>>>> 1.52