public static CreateReferenceFromFilePath ( string assemblyFilePath ) : Microsoft.CodeAnalysis.MetadataReference | ||
assemblyFilePath | string | |
return | Microsoft.CodeAnalysis.MetadataReference |
public static IAssemblySymbol GetAssemblySymbol(MetadataReference metadataReference, string language = LanguageNames.CSharp) { var compilation = CreateCompilation(metadataReference, language); var assemblySymbol = compilation.GetAssemblyOrModuleSymbol(metadataReference) as IAssemblySymbol; if (assemblySymbol == null) { return(null); } var referencePaths = GetReferencePaths(assemblySymbol); foreach (var referencePath in referencePaths) { var reference = MetadataAsSource.CreateReferenceFromFilePath(referencePath); compilation = compilation.AddReferences(reference); } assemblySymbol = compilation.GetAssemblyOrModuleSymbol(metadataReference) as IAssemblySymbol; return(assemblySymbol); }
public static IAssemblySymbol GetAssemblySymbol(string assemblyPath, string language = LanguageNames.CSharp) { var metadataReference = MetadataAsSource.CreateReferenceFromFilePath(assemblyPath); return(GetAssemblySymbol(metadataReference, language)); }