本文整理汇总了C#中IAssemblyResolver.LoadAssemblyDefinition方法的典型用法代码示例。如果您正苦于以下问题:C# IAssemblyResolver.LoadAssemblyDefinition方法的具体用法?C# IAssemblyResolver.LoadAssemblyDefinition怎么用?C# IAssemblyResolver.LoadAssemblyDefinition使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IAssemblyResolver
的用法示例。
在下文中一共展示了IAssemblyResolver.LoadAssemblyDefinition方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MSBuildProjectBuilder
public MSBuildProjectBuilder(string assemblyPath, string targetPath, ILanguage language,
IFrameworkResolver frameworkResolver,IDecompilationPreferences preferences, IFileGenerationNotifier notifier,
IAssemblyInfoService assemblyInfoService, VisualStudioVersion visualStudioVersion = VisualStudioVersion.VS2010,
ProjectGenerationSettings projectGenerationSettings = null, IProjectGenerationNotifier projectNotifier = null)
{
this.assemblyPath = assemblyPath;
this.TargetPath = targetPath;
this.targetDir = Path.GetDirectoryName(targetPath);
this.language = language;
this.frameworkResolver = frameworkResolver;
this.decompilationPreferences = preferences;
this.assemblyInfoService = assemblyInfoService;
this.visualStudioVersion = visualStudioVersion;
this.projectGenerationSettings = projectGenerationSettings;
this.currentAssemblyResolver = new WeakAssemblyResolver(GlobalAssemblyResolver.CurrentAssemblyPathCache);
var readerParameters = new ReaderParameters(currentAssemblyResolver);
assembly = currentAssemblyResolver.LoadAssemblyDefinition(assemblyPath, readerParameters, loadPdb: true);
platform = currentAssemblyResolver.GetTargetPlatform(assemblyPath);
namespaceHierarchyTree = assembly.BuildNamespaceHierarchyTree();
filePathsService =
new DefaultFilePathsService(
this.assembly,
this.assemblyPath,
Path.GetFileName(this.TargetPath),
this.UserDefinedTypes,
this.Resources,
namespaceHierarchyTree,
this.language,
Utilities.GetMaxRelativePathLength(targetPath));
this.modulesToProjectsFilePathsMap = this.filePathsService.GetModulesToProjectsFilePathsMap();
this.resourcesToPathsMap = this.filePathsService.GetResourcesToFilePathsMap();
this.xamlResourcesToPathsMap = this.filePathsService.GetXamlResourcesToFilePathsMap();
this.fileGeneratedNotifier = notifier;
this.assemblyInfo = GetAssemblyInfo();
this.projectNotifier = projectNotifier;
}