Tuesday, May 10, 2005

An easy way to find the .NET framework path in C#

string msNetPath = string.Empty;
msNetPath = typeof(object).Assembly.CodeBase;
msNetPath = msNetPath.Remove(0,8);
msNetPath = Directory.GetParent(msNetPath).ToString();