Oxplot not compatible with Caliburn.Micro + MEF

Oystein Bjorke 10 year бұрын 0
This discussion was imported from CodePlex

sharethl wrote at 2013-03-03 02:46:

Don't know should post on CM or here.

It is oxyplot-94236a582857 on XP.
CM with customized bootstrapper cannot execute GetInstance() with OxyPlot.dll in its folder.
If OxyPlot.dll is removed, it works fine, also, no problem on Win7.

Here is the executes, not virus. You can remove OxyPlot.dll and see it works fine.
Environment: XP.
https://www.box.com/s/pk71tu3zj0r2j109j6xe

This is ex message

GetInstance
Could not load file or assembly 'System.Core, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e, Retargetable=Yes' or one of its dependencies. The given assembly name or codebase was invalid. (Exception from HRESULT: 0x80131047)
 protected override object GetInstance(Type serviceType, string key) {
            try {
                string contract = string.IsNullOrEmpty(key) ? AttributedModelServices.GetContractName(serviceType) : key;
                var exports = container.GetExportedValues<object>(contract);

                if (exports.Count() > 0)
                    return exports.First();

                throw new Exception(string.Format("Could not locate any instances of contract {0}.", contract));
            }
            catch (Exception ex) {
                using (StreamWriter writer = new StreamWriter("log.txt")) {
                    writer.WriteLine("GetInstance");
                    writer.WriteLine(ex.Message);
                }
                return null;
            }
        }

tibel wrote at 2013-03-03 17:54:

Maybe this article will help you:
Using Portable Class Libraries - Update .NET Framework

As I don't get the exception on my machine.

sharethl wrote at 2013-03-03 22:48:

Wow, that really help, need to update .net 4.0.
Thanks Tibel