File tree 2 files changed +22
-0
lines changed
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) {
208
208
return assembly ;
209
209
}
210
210
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
+
211
229
//===================================================================
212
230
// Returns an assembly that's already been loaded
213
231
//===================================================================
Original file line number Diff line number Diff line change @@ -409,11 +409,15 @@ public static Assembly AddReference(string name)
409
409
{
410
410
assembly = AssemblyManager . LoadAssembly ( name ) ;
411
411
}
412
+ if ( assembly == null ) {
413
+ assembly = AssemblyManager . LoadAssemblyFullPath ( name ) ;
414
+ }
412
415
if ( assembly == null )
413
416
{
414
417
string msg = String . Format ( "Unable to find assembly '{0}'." , name ) ;
415
418
throw new System . IO . FileNotFoundException ( msg ) ;
416
419
}
420
+
417
421
return assembly ;
418
422
}
419
423
You can’t perform that action at this time.
0 commit comments