0
|
1 using System;
|
|
2 using System.Reflection;
|
|
3
|
|
4 using NUnit.Core.Extensibility;
|
|
5
|
|
6 namespace NUnitAddin
|
|
7 {
|
|
8 [NUnitAddin]
|
|
9 public class AssemblyResolverAddin : IAddin
|
|
10 {
|
|
11 public bool Install(IExtensionHost host)
|
|
12 {
|
|
13 AppDomain.CurrentDomain.AssemblyResolve += (sender, args) =>
|
|
14 {
|
|
15 var dir = Environment.CurrentDirectory;
|
|
16
|
|
17 if (args.Name.IndexOf("Sybase.AdoNet2.AseClient") >= 0)
|
|
18 return Assembly.LoadFrom(@"..\..\..\..\Redist\Sybase\Sybase.AdoNet2.AseClient.dll");
|
|
19 if (args.Name.IndexOf("Oracle.DataAccess") >= 0)
|
|
20 return Assembly.LoadFrom(@"..\..\..\..\Redist\Oracle\Oracle.DataAccess.dll");
|
|
21 if (args.Name.IndexOf("IBM.Data.DB2") >= 0)
|
|
22 return Assembly.LoadFrom(@"..\..\..\..\Redist\IBM\IBM.Data.DB2.dll");
|
|
23 if (args.Name.IndexOf("Mono.Security") >= 0)
|
|
24 return Assembly.LoadFrom(@"..\..\..\..\Redist\PostgreSql\Mono.Security.dll");
|
|
25
|
|
26 return null;
|
|
27 };
|
|
28
|
|
29 return true;
|
|
30 }
|
|
31 }
|
|
32 }
|