Exemplo n.º 1
0
        private IEnumerable <MetadataReference> CreateMetadataReferences()
        {
            var manager     = this.Services.GetService <VisualStudioMetadataReferenceManager>();
            var searchPaths = ReferencePathUtilities.GetReferencePaths();

            return(from fileName in new[] { "mscorlib.dll", "System.dll", "System.Core.dll" }
                   let fullPath = FileUtilities.ResolveRelativePath(fileName, basePath: null, baseDirectory: null, searchPaths: searchPaths, fileExists: File.Exists)
                                  where fullPath != null
                                  select manager.CreateMetadataReferenceSnapshot(fullPath, MetadataReferenceProperties.Assembly));
        }
 private static ImmutableArray <string> GetRuntimeDirectories()
 {
     return(ReferencePathUtilities.GetReferencePaths().Concat(
                new string[]
     {
         Environment.GetFolderPath(Environment.SpecialFolder.Windows),
         Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles),
         Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86),
         RuntimeEnvironment.GetRuntimeDirectory()
     }).Select(FileUtilities.NormalizeDirectoryPath).ToImmutableArray());
 }