There is an another way how to get path to a running assembly from itself besides I mentioned here. Use this simple snippet:
string[] cmd = Environment.GetCommandLineArgs();
string path_to_assembly = cmd[0];
/* cmd[1] and above contains command line arguments is any */
Resulting array is at least one element length or longer. First element of this array always contains path to the assembly. As a side effect – you can get command line params beginning from second element.
Unfortunately doesn’t work in .NET Compact Framework.
Technorati Tags:
C#,
.Net Framework
cc18651e-3769-4dec-b394-89e6f28baadf|0|.0