Assembly Entry Point

Assembly Entry Point



The following code explain how to get the entry point of assembly and much more information from assembly:


public static void Main(string[] args)
{
Assembly myAssInfo;
myAssInfo = Assembly.GetEntryAssembly();
// to get the entry point
if (myAssInfo.EntryPoint == null)
{
Console.WriteLine("The assembly has no entry point.");
}
else
{
Console.WriteLine(myAssInfo.EntryPoint.ToString());
}
// to get other info like location , code base & etc
Console.WriteLine("Location: ", myAssInfo.Location);
Console.WriteLine("Code Base: ", myAssInfo.CodeBase);
Console.WriteLine("Escaped Code Base: ", myAssInfo.EscapedCodeBase);
Console.WriteLine("Loaded from GAC: ", myAssInfo.GlobalAssemblyCache);

}


Comments

Guest Author: jyothi21 Sep 2013

it is useful..



  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name:
    Email: