@@ -26,6 +26,7 @@ public class EdgeCompiler
26
26
private static ScriptConsole _console ;
27
27
private static ILog _logger ;
28
28
private static IInitializationServices _initializationServices ;
29
+ private static string _libPath ;
29
30
30
31
static EdgeCompiler ( )
31
32
{
@@ -39,8 +40,8 @@ static EdgeCompiler()
39
40
_initializationServices = new InitializationServices ( _logger , overrides ) ;
40
41
41
42
var resolver = _initializationServices . GetAppDomainAssemblyResolver ( ) ;
42
- var dir = Path . GetDirectoryName ( typeof ( EdgeCompiler ) . Assembly . Location ) ;
43
- var assemblies = Directory . GetFiles ( dir , "*.dll" ) ;
43
+ _libPath = Path . GetDirectoryName ( typeof ( EdgeCompiler ) . Assembly . Location ) ;
44
+ var assemblies = Directory . GetFiles ( _libPath , "*.dll" ) ;
44
45
resolver . AddAssemblyPaths ( assemblies ) ;
45
46
}
46
47
@@ -97,7 +98,6 @@ private IScriptExecutor GetExecutor(List<string> references, string rootPath)
97
98
{
98
99
99
100
var builder = new ScriptServicesBuilder ( _console , _logger , initializationServices : _initializationServices ) .
100
- Debug ( true ) .
101
101
ScriptName ( "" ) ;
102
102
103
103
builder . LoadModules ( "csx" ) ;
@@ -109,7 +109,7 @@ private IScriptExecutor GetExecutor(List<string> references, string rootPath)
109
109
executor . Initialize ( paths , packs ) ;
110
110
111
111
executor . AddReferences ( references . ToArray ( ) ) ;
112
- var reference = Path . GetDirectoryName ( Assembly . GetExecutingAssembly ( ) . Location ) + @"\ ScriptCs.Contracts.dll";
112
+ var reference = Path . Combine ( _libPath , " ScriptCs.Contracts.dll") ;
113
113
executor . AddReferences ( reference ) ;
114
114
executor . ImportNamespaces ( "ScriptCs.Contracts" ) ;
115
115
return executor ;
0 commit comments