R
Rick
I have a string value 5.2.1 and I need to know how to compare if this value
is greater than or equlas to 5.1.4
is greater than or equlas to 5.1.4
I have a string value 5.2.1 and I need to know how to compare if this value
is greater than or equlas to 5.1.4
Rick said:Couls you please provide me with more information?
How do I load them in a version class?
Actually, I need it for VS2003 not VS2005.
Peter said:If you could explain what about the String.Compare() method doesn't
accomplish your goal, that would help us provide a better answer.
I have a string value 5.2.1 and I need to know how to compare if this
value is greater than or equlas to 5.1.4
Peter Duniho said:As Hans suggested; I've already tried the following code but it won't
work.
It compiles fine but generate an error "An exception has been thrown by
the
target of an invocation" when application is launched.
Assembly myAsm = Assembly.Load("MyApplicationNameWithoutDotEXE");
AssemblyName aName = myAsm.GetName();
Version ver = aName.Version;
The following code works fine:
using System;
using System.Reflection;
namespace TestAssemblyVersion
{
class Program
{
static void Main(string[] args)
{
// Assembly assembly = Assembly.GetExecutingAssembly();
Assembly assembly = Assembly.Load("TestAssemblyVersion");
Console.WriteLine("\"{0}\"",
assembly.GetName().Version.ToString());
Console.ReadLine();
}
}
}
It seems to me that the commented line is preferable -- your assembly
should already be loaded, so why load it again? -- but either produces the
expected output.
So, you've done something wrong. You need to post a concise-but-complete
code sample showing _exactly_ what you _are_ doing, otherwise it's not
possible to understand what the mistake is.
Pete