File tree Expand file tree Collapse file tree 2 files changed +22
-0
lines changed
Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -208,6 +208,24 @@ public static Assembly LoadAssemblyPath(string name) {
208208 return assembly ;
209209 }
210210
211+ /// <summary>
212+ /// Loads an assembly using full path.
213+ /// </summary>
214+ /// <param name="name"></param>
215+ /// <returns></returns>
216+ public static Assembly LoadAssemblyFullPath ( string name ) {
217+ Assembly assembly = null ;
218+ if ( Path . IsPathRooted ( name ) ) {
219+ if ( ! Path . HasExtension ( name ) )
220+ name = name + ".dll" ;
221+ if ( File . Exists ( name ) ) {
222+ try { assembly = Assembly . LoadFrom ( name ) ; }
223+ catch { }
224+ }
225+ }
226+ return assembly ;
227+ }
228+
211229 //===================================================================
212230 // Returns an assembly that's already been loaded
213231 //===================================================================
Original file line number Diff line number Diff line change @@ -409,11 +409,15 @@ public static Assembly AddReference(string name)
409409 {
410410 assembly = AssemblyManager . LoadAssembly ( name ) ;
411411 }
412+ if ( assembly == null ) {
413+ assembly = AssemblyManager . LoadAssemblyFullPath ( name ) ;
414+ }
412415 if ( assembly == null )
413416 {
414417 string msg = String . Format ( "Unable to find assembly '{0}'." , name ) ;
415418 throw new System . IO . FileNotFoundException ( msg ) ;
416419 }
420+
417421 return assembly ;
418422 }
419423
You can’t perform that action at this time.
0 commit comments