Visual Studio WPF Designer cannot find Preview 5 dll

Jan 6, 2012 at 11:12 PM

In Visual Studio 10 I made a folder "lib" that sits along side my project folders.  In this folder I placed the *.dll from MEF 2 Preview 5, and my application runs great.  The problem is the WPF designer surface inside VS throws an Unhandled exception (See Error Message Below) after a few clicks of the mouse.  I can click "reload the designer" and it will again work for a few moments.

The apparent problem may not be completely related to MEF, but I thought someone here might have the problem.  It appears that the designer cannot find the System.ComponentModel.Composition.CodePlex.dll in its search path.  The following post seems related, but the workaround did not work (http://connect.microsoft.com/VisualStudio/feedback/details/694333/vs-2010-c-form-designer-cant-find-native-dll-used-by-managed-control-is-my-hack-necessary).  I also tried updating my Reference Path for the project with no success.

Note:  I am using WPF MVVM pattern, and importing/exporting with MEF.  Also if I reference the .NET "System.ComponentModel.Composition" in my project the designer surface works properly.

WPF Designer displays this along with alot of stack information:

System.Reflection.Adds.UnresolvedAssemblyException
Type universe cannot resolve assembly: System.ComponentModel.Composition.CodePlex, Version=4.1.2.0, Culture=neutral, PublicKeyToken=13e5ffd4e05db186.

Thanks,

Jan 7, 2012 at 3:34 AM

Unbelievable, I solved this one myself by searching the internet for hours.

Apparently when you download any zip files (ie. MEF 2 Preview 5 binaries) Windows automatically blocks the files for security purposes.  The worst part is that you can unzip the dlls without ever knowing there are marked as blocked by the OS.  Even worse the VS application runs fine with the blocked dlls, but the WPF designer works intermediately (Great security).

The post that reveals the issue is: http://syncor.blogspot.com/2011/06/wpf-and-ninject.html and I hope it can help someone else...

Thanks,

Jan 7, 2012 at 6:25 AM
My most popular blog post

http://blogs.msdn.com/b/gblock/archive/2006/12/19/tips-steams-zones-vista-and-blocked-files-in-ie.aspx

I blogged about it after hitting the same.

Sent from my Windows Phone

From: aidesigner
Sent: 1/6/2012 7:34 PM
To: Glenn Block
Subject: Re: Visual Studio WPF Designer cannot find Preview 5 dll [MEF:285280]

From: aidesigner

Unbelievable, I solved this one myself by searching the internet for hours.

Apparently when you download any zip files (ie. MEF 2 Preview 5 binaries) Windows automatically blocks the files for security purposes. The worst part is that you can unzip the dlls without ever knowing there are marked as blocked by the OS. Even worse the VS application runs fine with the blocked dlls, but the WPF designer works intermediately (Great security).

The post that reveals the issue is: http://syncor.blogspot.com/2011/06/wpf-and-ninject.html and I hope it can help someone else...

Thanks,