CustomModuleCatalog bug

Mar 13, 2013 at 5:56 AM
Edited Mar 13, 2013 at 5:58 AM
Maybe it's not a bug.
Problem:
The CustomModuleCatalog load required libraries with this code:
        IEnumerable<ModuleInfo> GetAssemblyModuleInfos(DirectoryInfo directory, Type IModuleType)
        {
            var result = directory.GetFiles("*.dll")
                .Where(file => new AssemblyFile(file.Name).Managed)
                .SelectMany(file => Assembly.ReflectionOnlyLoadFrom(file.FullName)
                                        .GetExportedTypes()
                                        .Where(IModuleType.IsAssignableFrom)
                                        .Where(t => t != IModuleType)
                                        .Where(t => !t.IsAbstract)
                                        .Select(type => CreateModuleInfo(type)));
            return result;
        }
in the line
      Assembly.ReflectionOnlyLoadFrom(file.FullName).GetExportedTypes()
this will cause some problem.
As Calcium depends on Unity, and the Unity which is build on Framework 3.5 is depends On System.Core 3.5. So the Calcium will load the System.Core 3.5, even the project is 4.0. So if the we develop Calcium projects on Windows 2003, or others without Framework 3.5, the Calcium won't work with the exception :
System.IO.FileNotFoundException.
as it can't fine the “System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089”

Any suggestions to solve this? Thanks.