I'm working on an extensible WPF application using C#. For the extensibility, I use MEF (Managed Extensibility Framework). But since today, the XAML designer doesn't work for the MainWindow.xaml
anymore. It throws a FileNotFoundException
with this message:
Could not load file or assembly 'System.ComponentModel.Composition.CodePlex, Version=4.1.2.0, Culture=neutral, PublicKeyToken=13e5ffd4e05db186' or one of its dependencies. The specified module could not be found.
But the strange thing is, that the file does exist. I copied it into the bin\debug
folder. And added it to the references (Yes, I tried to re-add it, but that didn't help). Yet another strange thing is, that it seems like it is caused by the XAML code, because the designer works for all other windows. I've already tried to mark some suspicious parts (ItemControls
that list plugins) as comment (I don't want to remove them). Well, it worked once, but then I built the solution and the designer crashed (out of memory). Since then I have the same problem again.
Edit:
I found out, that the XAML wasn't the problem. When I remove the reference to System.ComponentModel.Composition.CodePlex
and every code that uses this library, the problem is fixed - until I restart Visual Studio or the Designer.