This project has moved and is read-only. For the latest updates, please go here.

Mono compatibility

Nov 11, 2009 at 11:02 PM
Edited Nov 11, 2009 at 11:04 PM

Has anyone tried running MEF on Mono yet? I ran into two problems so far with the DirectoryCatalog.

        private string[] GetFiles()
string[] files = Directory.GetFiles(this._fullPath, this._searchPattern);
return Array.ConvertAll<string, string>(files, (file) => file.ToUpperInvariant());

private static string GetFullPath(string path)
if (!IOPath.IsPathRooted(path) && AppDomain.CurrentDomain.BaseDirectory != null)
path = IOPath.Combine(AppDomain.CurrentDomain.BaseDirectory, path);

return IOPath.GetFullPath(path).ToUpperInvariant();

The ToUpperInvariant() calls are converting directory and file names to uppercase, which obviously breaks compatibility with Unix-based platforms. Is there a specific reason that directory/file paths are being converted to uppercase?

Nov 12, 2009 at 12:40 AM

The DirectoryCatalog used to allow you to add multiple directories so it was used as a way to normalize the directory names, but that is no longer the case. We should probably remove the ToUpperInvariant() now, in fact we have a issue for this, I wouldn't bet on it being changed for .Net 4.0 but there is no reason it can't be fixed in the Mono version of MEF.

Nov 13, 2009 at 6:58 AM

I will be speaking to Miguel de Icaza about this. It should be easy for them to update in their codebase.