Visual Studio 2010 designer cannot find assembly

The following error appears in the VS2010 constructor:

System.Reflection.Adds.UnresolvedAssemblyException Universe type cannot allow assembly: Microsoft.Expression.Interactions, Version = 4.0.5.0, Culture = neutral, PublicKeyToken = 31bf3856ad364e35.

This is the Silverlight project referenced by the missing assembly. The project compiles and works fine.

I looked with fuslogvw and I can not find this error message.

Do I need to copy the dll somewhere where the Designer can find it?

+3
source share
3 answers

zipped.dll, Vista Win7, . , . , , Ninject.

+1

, , .

Blend SDK System.Windows.Interactivity Microsoft.Expressions.Interactions.

, DataTrigger . , IntelliSense XAML, .

, , Framework .

: http://connect.microsoft.com/VisualStudio/feedback/details/648819/visual-studio-2010-silverlight-designer-crash

SharpDevelops ILSpy . → . . . Expression.Interactions .

In AssemblyInfo.csyou can do the trick.

In Microsoft.Expression.Interactions:

[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")]

in System.Windows.Interactivity:

[assembly: XmlnsPrefix("http://yourdomain.com/interactions", "i")]
[assembly: XmlnsDefinition("http://yourdomain.com/interactions", "System.Windows.Interactivity")]

Now place a link to new projects in your assembly or create assemblies and copy their version to the folder with your libraries and directly link to the built-in versions.

In XAML, add a new namespace to your rootelement as a 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 functionality and expressions combined into one xmlns, and, of course, there is no constructor exception, and IntelliSense will no longer break.

0
source

Source: https://habr.com/ru/post/1795553/


All Articles