I am getting the following error in the VS2010 designer:
Type universe cannot resolve assembly: Microsoft.Expression.Interactions, Version=18.104.22.168, Culture=neutral, PublicKeyToken=31bf3856ad364e35.
It is a Silverlight project and the missing assembly is referenced by the project. The project compiles and runs fine.
I looked with fuslogvw and I can't find that error message.
Do I need to copy the dll somewhere where the Designer can find it?
This assembly is part of Blend SDK. You can install it for free from here: Microsoft Expression Blend Software Development Kit (SDK) for .NET 4.
If you're using zipped .dll's downloaded from the web under Vista or Win7, the OS blocking feature can cause this problem. I wrote up a blog post last week about how to unblock prior to unzipping a file. I know it solved a very similar problem I was having with Ninject.
I also faced this problem an finally resolved it in an unusual but successful way.
We are using Blend SDK's
Everything works fine, unless the designer crashes when using an inherited
DataTrigger with the same Exception. This would not be the mess, but the exception also breaks IntelliSense in the whole XAML Document, which is not acceptable.
Since this is a reprocducible and reportet error, I decided to solve the problem using disassembling, since we need the extensions to the Interaction Framework.
Simply get a Versions of SharpDevelops ILSpy, and open the two assemblies within it. Select the assembly from the list and go to File -> Save. This will disassemble the whole projects. Integrate those in a blank solution and change the assembly names. Rebuild the reference from the Expression.Interactions library to your new disassembled version.
AssemblyInfo.cs you can do a trick.
[assembly: XmlnsPrefix("http://yourdomain.com/interactions", "i")] [assembly: XmlnsDefinition("http://yourdomain.com/interactions", "Microsoft.Expression.Interactivity.Core")] [assembly: XmlnsDefinition("http://yourdomain.com/interactions", "Microsoft.Expression.Interactivity.Input")] [assembly: XmlnsDefinition("http://yourdomain.com/interactions", "Microsoft.Expression.Interactivity.Layout")] [assembly: XmlnsDefinition("http://yourdomain.com/interactions", "Microsoft.Expression.Interactivity.Media")]
[assembly: XmlnsPrefix("http://yourdomain.com/interactions", "i")] [assembly: XmlnsDefinition("http://yourdomain.com/interactions", "System.Windows.Interactivity")]
Now put a reference to the new projects in your assembly, or build the assemblies and copy a version of them to your libraries folder and reference the built versions directly.
In XAML add the new namespace to your rootelement like page/window:
<RootElement xmlns:i="http://yourdomain.com/interactions"> <!-- your xaml code --> <i:Interaction.Triggers> ... </i:Interaction.Triggers> </RootElement>
It works like a charm. You can use both interaction and expressions functionality combined into one xmlns and of course, the designer exception is gone and IntelliSense will no longer break.