Research Assembly Setting!
1
public static void InitTestAssembly(TestContext context)
2
{
3
if (AssemblyResolver.referencePaths != null)
4
{
5
// already initialized
6
return;
7
}
8![](/Images/OutliningIndicators/InBlock.gif)
9
AssemblyResolver.referencePaths = new List<string>();
10![](/Images/OutliningIndicators/InBlock.gif)
11
// setup assembly resolver![](https://www.cnblogs.com/Images/dot.gif)
12
string referencePath = System.Configuration.ConfigurationManager.AppSettings["ReferencePath"];
13![](/Images/OutliningIndicators/InBlock.gif)
14
if (referencePath != null)
15
{
16
// paths should be semi-colon delimited
17
string[] paths = referencePath.Split(';');
18![](/Images/OutliningIndicators/InBlock.gif)
19
foreach (string path in paths)
20
{
21
string fullPath = System.Environment.ExpandEnvironmentVariables(path);
22![](/Images/OutliningIndicators/InBlock.gif)
23
if (!Path.IsPathRooted(fullPath))
24
{
25
// make all relative paths relative to this file
26
string myAssembly = System.Reflection.Assembly.GetExecutingAssembly().Location;
27
string myPath = Path.GetDirectoryName(myAssembly);
28![](/Images/OutliningIndicators/InBlock.gif)
29
fullPath = Path.GetFullPath(Path.Combine(myPath, fullPath));
30
}
31![](/Images/OutliningIndicators/InBlock.gif)
32
referencePaths.Add(fullPath);
33
}
34
}
35![](/Images/OutliningIndicators/InBlock.gif)
36
// hook up our ResolveAssembly method in the app domain
37
AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(ResolveAssembly);
38
}
39![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
2
![](/Images/OutliningIndicators/ExpandedBlockStart.gif)
3
![](/Images/OutliningIndicators/InBlock.gif)
4
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
5
![](/Images/OutliningIndicators/InBlock.gif)
6
![](/Images/OutliningIndicators/InBlock.gif)
7
![](/Images/OutliningIndicators/ExpandedSubBlockEnd.gif)
8
![](/Images/OutliningIndicators/InBlock.gif)
9
![](/Images/OutliningIndicators/InBlock.gif)
10
![](/Images/OutliningIndicators/InBlock.gif)
11
![](/Images/OutliningIndicators/InBlock.gif)
![](https://www.cnblogs.com/Images/dot.gif)
12
![](/Images/OutliningIndicators/InBlock.gif)
13
![](/Images/OutliningIndicators/InBlock.gif)
14
![](/Images/OutliningIndicators/InBlock.gif)
15
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
16
![](/Images/OutliningIndicators/InBlock.gif)
17
![](/Images/OutliningIndicators/InBlock.gif)
18
![](/Images/OutliningIndicators/InBlock.gif)
19
![](/Images/OutliningIndicators/InBlock.gif)
20
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
21
![](/Images/OutliningIndicators/InBlock.gif)
22
![](/Images/OutliningIndicators/InBlock.gif)
23
![](/Images/OutliningIndicators/InBlock.gif)
24
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
25
![](/Images/OutliningIndicators/InBlock.gif)
26
![](/Images/OutliningIndicators/InBlock.gif)
27
![](/Images/OutliningIndicators/InBlock.gif)
28
![](/Images/OutliningIndicators/InBlock.gif)
29
![](/Images/OutliningIndicators/InBlock.gif)
30
![](/Images/OutliningIndicators/ExpandedSubBlockEnd.gif)
31
![](/Images/OutliningIndicators/InBlock.gif)
32
![](/Images/OutliningIndicators/InBlock.gif)
33
![](/Images/OutliningIndicators/ExpandedSubBlockEnd.gif)
34
![](/Images/OutliningIndicators/ExpandedSubBlockEnd.gif)
35
![](/Images/OutliningIndicators/InBlock.gif)
36
![](/Images/OutliningIndicators/InBlock.gif)
37
![](/Images/OutliningIndicators/InBlock.gif)
38
![](/Images/OutliningIndicators/ExpandedBlockEnd.gif)
39
![](/Images/OutliningIndicators/None.gif)
- Make people around you successful is the biggest contribution to ourselves. -