private string GetAssemblyPath(IAssemblySymbol assembly) { MetadataReference reference = compilation.GetMetadataReference(assembly); if (reference is PortableExecutableReference peReference) { return(peReference.FilePath); } return(null); }