本文整理汇总了C#中ICSharpCode.ILSpy.AssemblyList.AddSearchPath方法的典型用法代码示例。如果您正苦于以下问题:C# AssemblyList.AddSearchPath方法的具体用法?C# AssemblyList.AddSearchPath怎么用?C# AssemblyList.AddSearchPath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ICSharpCode.ILSpy.AssemblyList
的用法示例。
在下文中一共展示了AssemblyList.AddSearchPath方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DumpNetModule
static void DumpNetModule(ProjectInfo info, List<ProjectInfo> projectFiles)
{
var fileName = info.AssemblyFileName;
if (string.IsNullOrEmpty(fileName))
throw new Exception(".NET module filename is empty or null");
var asmList = new AssemblyList("dnspc.exe", false);
asmList.UseGAC = !noGac;
asmList.AddSearchPath(Path.GetDirectoryName(fileName));
foreach (var path in asmPaths)
asmList.AddSearchPath(path);
var lasm = new LoadedAssembly(asmList, fileName);
var opts = new DecompilationOptions {
FullDecompilation = true,
CancellationToken = new CancellationToken(),
};
TextWriter writer = null;
try {
var lang = GetLanguage();
if (useStdout)
writer = System.Console.Out;
else {
var baseDir = GetProjectDir(lang, fileName);
Directory.CreateDirectory(baseDir);
writer = new StreamWriter(info.ProjectFileName, false, Encoding.UTF8);
opts.SaveAsProjectDirectory = baseDir;
opts.DontReferenceStdLib = noCorlibRef;
opts.ProjectFiles = projectFiles;
opts.ProjectGuid = info.ProjectGuid;
opts.DontShowCreateMethodBodyExceptions = dontMaskErr;
Console.WriteLine("Saving {0} to {1}", fileName, baseDir);
}
lang.DecompileAssembly(lasm, new PlainTextOutput(writer), opts);
}
finally {
if (!useStdout && writer != null)
writer.Dispose();
}
}