S
sloan
Here is the msdn code for getting the .CodeBase property of an Assembly
Assembly SampleAssembly;
// Instantiate a target object.
Int32 Integer1 = new Int32();
Type Type1;
// Set the Type instance to the target class type.
Type1 = Integer1.GetType();
// Instantiate an Assembly class to the assembly housing the Integer type.
SampleAssembly = Assembly.GetAssembly(Integer1.GetType());
// Gets the location of the assembly using file: protocol.
Console.WriteLine("CodeBase=" + SampleAssembly.CodeBase);
Notice the "new Int32". (aka, an object instantiation)
Is there a way to statically get the Assembly.CodeBase ~without
instantiating an object ?
Take the simple example where you create a new/blank Console.Application.
How can I get the .CodeBase of that console app... remembering that I'm in
the
static world.. as such
static void Main(string[] args)
{
}
Assembly SampleAssembly;
// Instantiate a target object.
Int32 Integer1 = new Int32();
Type Type1;
// Set the Type instance to the target class type.
Type1 = Integer1.GetType();
// Instantiate an Assembly class to the assembly housing the Integer type.
SampleAssembly = Assembly.GetAssembly(Integer1.GetType());
// Gets the location of the assembly using file: protocol.
Console.WriteLine("CodeBase=" + SampleAssembly.CodeBase);
Notice the "new Int32". (aka, an object instantiation)
Is there a way to statically get the Assembly.CodeBase ~without
instantiating an object ?
Take the simple example where you create a new/blank Console.Application.
How can I get the .CodeBase of that console app... remembering that I'm in
the
static world.. as such
static void Main(string[] args)
{
}