3
3
using System . Collections . Immutable ;
4
4
using System . Linq ;
5
5
using System . Reflection ;
6
- using System . Runtime . InteropServices ;
7
6
using System . Text ;
8
7
using System . Threading . Tasks ;
9
8
using Dotnet . Script . Core . Internal ;
@@ -24,10 +23,6 @@ namespace Dotnet.Script.Core
24
23
{
25
24
public class ScriptCompiler
26
25
{
27
- // Note: Windows only, Mac and Linux needs something else?
28
- [ DllImport ( "Kernel32.dll" ) ]
29
- private static extern IntPtr LoadLibrary ( string path ) ;
30
-
31
26
private ScriptEnvironment _scriptEnvironment ;
32
27
33
28
private Logger _logger ;
@@ -120,8 +115,6 @@ public virtual ScriptCompilationContext<TReturn> CreateCompilationContext<TRetur
120
115
121
116
scriptOptions = AddScriptReferences ( scriptOptions , loadedAssembliesMap , scriptDependenciesMap ) ;
122
117
123
- LoadNativeAssets ( runtimeDependencies ) ;
124
-
125
118
AppDomain . CurrentDomain . AssemblyResolve +=
126
119
( sender , args ) => MapUnresolvedAssemblyToRuntimeLibrary ( scriptDependenciesMap , loadedAssembliesMap , args ) ;
127
120
@@ -150,17 +143,6 @@ private RuntimeDependency[] GetRuntimeDependencies(ScriptContext context)
150
143
}
151
144
}
152
145
153
- private void LoadNativeAssets ( RuntimeDependency [ ] runtimeDependencies )
154
- {
155
- foreach ( var nativeAsset in runtimeDependencies . SelectMany ( rtd => rtd . NativeAssets ) . Distinct ( ) )
156
- {
157
- if ( _scriptEnvironment . IsWindows )
158
- {
159
- LoadLibrary ( nativeAsset ) ;
160
- }
161
- }
162
- }
163
-
164
146
private ScriptOptions AddScriptReferences ( ScriptOptions scriptOptions , Dictionary < string , Assembly > loadedAssembliesMap , Dictionary < string , RuntimeAssembly > scriptDependenciesMap )
165
147
{
166
148
foreach ( var runtimeAssembly in scriptDependenciesMap . Values )
0 commit comments