@@ -31,18 +31,7 @@ private EnvironmentManager()
31
31
32
32
urlBuilder = new UrlBuilder ( ) ;
33
33
34
- Assembly executingAssembly = Assembly . GetExecutingAssembly ( ) ;
35
- string assemblyLocation = executingAssembly . Location ;
36
-
37
- // If we're shadow copying,. fiddle with
38
- // the codebase instead
39
- if ( AppDomain . CurrentDomain . ShadowCopyFiles )
40
- {
41
- Uri uri = new Uri ( executingAssembly . CodeBase ) ;
42
- assemblyLocation = uri . LocalPath ;
43
- }
44
-
45
- string currentDirectory = Path . GetDirectoryName ( assemblyLocation ) ;
34
+ string currentDirectory = this . CurrentDirectory ;
46
35
DirectoryInfo info = new DirectoryInfo ( currentDirectory ) ;
47
36
while ( info != info . Root && string . Compare ( info . Name , "build" , StringComparison . OrdinalIgnoreCase ) != 0 )
48
37
{
@@ -80,6 +69,26 @@ public Browser Browser
80
69
get { return browser ; }
81
70
}
82
71
72
+ public string CurrentDirectory
73
+ {
74
+ get
75
+ {
76
+ Assembly executingAssembly = Assembly . GetExecutingAssembly ( ) ;
77
+ string assemblyLocation = executingAssembly . Location ;
78
+
79
+ // If we're shadow copying,. fiddle with
80
+ // the codebase instead
81
+ if ( AppDomain . CurrentDomain . ShadowCopyFiles )
82
+ {
83
+ Uri uri = new Uri ( executingAssembly . CodeBase ) ;
84
+ assemblyLocation = uri . LocalPath ;
85
+ }
86
+
87
+ string currentDirectory = Path . GetDirectoryName ( assemblyLocation ) ;
88
+ return currentDirectory ;
89
+ }
90
+ }
91
+
83
92
public TestWebServer WebServer
84
93
{
85
94
get { return webServer ; }
0 commit comments