@@ -39,6 +39,7 @@ static ScriptCompiler()
39
39
} ) ;
40
40
}
41
41
42
+ //Note: We should set this according to the SDK being used
42
43
protected virtual IEnumerable < string > ImportedNamespaces => new [ ]
43
44
{
44
45
"System" ,
@@ -94,7 +95,7 @@ public virtual ScriptOptions CreateScriptOptions(ScriptContext context, IList<Ru
94
95
{
95
96
var scriptMap = runtimeDependencies . ToDictionary ( rdt => rdt . Name , rdt => rdt . Scripts ) ;
96
97
var opts = ScriptOptions . Default . AddImports ( ImportedNamespaces )
97
- . WithSourceResolver ( new NuGetSourceReferenceResolver ( new SourceFileResolver ( ImmutableArray < string > . Empty , context . WorkingDirectory ) , scriptMap ) )
98
+ . WithSourceResolver ( new NuGetSourceReferenceResolver ( new SourceFileResolver ( ImmutableArray < string > . Empty , context . WorkingDirectory ) , scriptMap ) )
98
99
. WithMetadataResolver ( new NuGetMetadataReferenceResolver ( ScriptMetadataResolver . Default . WithBaseDirectory ( context . WorkingDirectory ) ) )
99
100
. WithEmitDebugInformation ( true )
100
101
. WithLanguageVersion ( LanguageVersion . Preview )
@@ -200,7 +201,7 @@ AssemblyLoadContext is not ScriptAssemblyLoadContext salc ||
200
201
Assembly loadedAssembly = null ;
201
202
if ( homogenization )
202
203
loadedAssembliesMap . TryGetValue ( runtimeAssembly . Name . Name , out loadedAssembly ) ;
203
-
204
+
204
205
if ( loadedAssembly == null )
205
206
{
206
207
_logger . Trace ( "Adding reference to a runtime dependency => " + runtimeAssembly ) ;
@@ -290,7 +291,7 @@ private Assembly MapUnresolvedAssemblyToRuntimeLibrary(IDictionary<string, Runti
290
291
if ( assemblyName . Version == null || runtimeAssembly . Name . Version > assemblyName . Version )
291
292
{
292
293
loadedAssemblyMap . TryGetValue ( assemblyName . Name , out var loadedAssembly ) ;
293
- if ( loadedAssembly != null )
294
+ if ( loadedAssembly != null )
294
295
{
295
296
_logger . Trace ( $ "Redirecting { assemblyName } to already loaded { loadedAssembly . GetName ( ) . Name } ") ;
296
297
return loadedAssembly ;
0 commit comments