@@ -252,75 +252,6 @@ public static Assembly FindLoadedAssembly(string name)
252252 return null ;
253253 }
254254
255- /// <summary>
256- /// Given a qualified name of the form A.B.C.D, attempt to load
257- /// an assembly named after each of A.B.C.D, A.B.C, A.B, A. This
258- /// will only actually probe for the assembly once for each unique
259- /// namespace. Returns true if any assemblies were loaded.
260- /// </summary>
261- /// <remarks>
262- /// TODO item 3 "* Deprecate implicit loading of assemblies":
263- /// Set the fromFile flag if the name of the loaded assembly matches
264- /// the fully qualified name that was requested if the framework
265- /// actually loads an assembly.
266- /// Call ONLY for namespaces that HAVE NOT been cached yet.
267- /// </remarks>
268- public static bool LoadImplicit ( string name , Action < Exception > assemblyLoadErrorHandler , bool warn = true )
269- {
270- string [ ] names = name . Split ( '.' ) ;
271- var loaded = false ;
272- var s = "" ;
273- Assembly lastAssembly = null ;
274- HashSet < Assembly > assembliesSet = null ;
275- for ( var i = 0 ; i < names . Length ; i ++ )
276- {
277- s = i == 0 ? names [ 0 ] : s + "." + names [ i ] ;
278- if ( ! probed . ContainsKey ( s ) )
279- {
280- if ( assembliesSet == null )
281- {
282- assembliesSet = new HashSet < Assembly > ( AppDomain . CurrentDomain . GetAssemblies ( ) ) ;
283- }
284- Assembly a = FindLoadedAssembly ( s ) ;
285- try
286- {
287- if ( a == null )
288- {
289- a = LoadAssemblyPath ( s ) ;
290- }
291-
292- if ( a == null )
293- {
294- a = LoadAssembly ( s ) ;
295- }
296- }
297- catch ( FileLoadException e ) { assemblyLoadErrorHandler ( e ) ; }
298- catch ( BadImageFormatException e ) { assemblyLoadErrorHandler ( e ) ; }
299- catch ( System . Security . SecurityException e ) { assemblyLoadErrorHandler ( e ) ; }
300- catch ( PathTooLongException e ) { assemblyLoadErrorHandler ( e ) ; }
301-
302- if ( a != null && ! assembliesSet . Contains ( a ) )
303- {
304- loaded = true ;
305- lastAssembly = a ;
306- }
307- probed [ s ] = 1 ;
308- }
309- }
310-
311- // Deprecation warning
312- if ( warn && loaded )
313- {
314- string location = Path . GetFileNameWithoutExtension ( lastAssembly . Location ) ;
315- string deprWarning = "The module was found, but not in a referenced namespace.\n " +
316- $ "Implicit loading is deprecated. Please use clr.AddReference('{ location } ').";
317- Exceptions . deprecation ( deprWarning ) ;
318- }
319-
320- return loaded ;
321- }
322-
323-
324255 /// <summary>
325256 /// Scans an assembly for exported namespaces, adding them to the
326257 /// mapping of valid namespaces. Note that for a given namespace
0 commit comments