diff --git a/CodeCoverage/Program.cs b/CodeCoverage/Program.cs index 7fea4ca..6a53798 100644 --- a/CodeCoverage/Program.cs +++ b/CodeCoverage/Program.cs @@ -45,7 +45,12 @@ public static void Main(string[] args) //try to make a basepath string workingDirectory = Environment.CurrentDirectory; - string projectDirectory = Directory.GetParent(workingDirectory).Parent.Parent.Parent.FullName; + //check if we can see the Packages folder + if(!Directory.Exists(basePath + @"\Packages")) + { + //if we cant, then we are in the wrong directory, so go up a few directories + basePath = Directory.GetParent(workingDirectory).Parent.Parent.Parent.Parent.FullName; + } Console.WriteLine("Working Directory: " + projectDirectory); basePath = projectDirectory; XMLPath = basePath + XMLPath;