public MetadataReferenceFeatureProvider(DynamicAssemblyCollection dynamicAssemblies)
 {
     _metadataReferences = AppDomain.CurrentDomain.GetAssemblies()
                           .Where(x => !x.IsDynamic && !string.IsNullOrEmpty(x.Location))
                           .Select(x => MetadataReference.CreateFromFile(x.Location))
                           .Concat((dynamicAssemblies ?? Enumerable.Empty <byte[]>())
                                   .Select(x => (MetadataReference)MetadataReference.CreateFromImage(x)))
                           .Concat(new MetadataReference[]
     {
         // Razor/MVC assemblies that might not be loaded yet
         MetadataReference.CreateFromFile(typeof(IHtmlContent).GetTypeInfo().Assembly.Location),
         MetadataReference.CreateFromFile(Assembly.Load(new AssemblyName("Microsoft.CSharp")).Location)
     })
                           .ToList();
 }
 public MetadataReferenceFeatureProvider(DynamicAssemblyCollection dynamicAssemblies)
 {
     _dynamicAssemblies = dynamicAssemblies;
 }
        public override bool Equals(object obj)
        {
            DynamicAssemblyCollection other = obj as DynamicAssemblyCollection;

            return(other != null && _assemblies.SequenceEqual(other._assemblies));
        }