10
votes

I'm trying to run PRISM (MEF) example project, but get this error:

Managed Debugging Assistant 'BindingFailure' has detected a problem in 'Prism4MefDemo.vshost.exe'.

Additional information: The assembly with display name 'Microsoft.Windows.Shell' failed to load in the 'Load' binding context of the AppDomain with ID 1. The cause of the failure was: System.IO.FileLoadException: Could not load file or assembly 'Microsoft.Windows.Shell, Version=3.5.41019.1, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

I've tried to remove and manualy add reference to Microsoft.Windows.Shell but still nothing.

The version of this DLL is 3.0.1.0, and not 3.5.41019.1 as in the Exception.

This is the line with the Excecption:

    protected override DependencyObject CreateShell()
    {
        return this.Container.GetExportedValue<ShellWindow>();
    }

How can I fix it? Thanks.

4
What version of .net are you using, and are you forcing a specific cpu architecture?Kelly Elton

4 Answers

18
votes

Finally I solved this issue by installing Multilingual App Toolkit from here and Add Reference to "Microsoft.Windows.Shell.dll" from the location "C:\Program Files (x86)\Multilingual App Toolkit" or copy the dll to your private assembly folder and refer it.

When you install Microsoft.Windows.Shell.dll from Nuget, it was installing v3.0.1, But the actual expected version was v3.5.41019.1. you ll get this new version from the above path.

Thanks

7
votes

So after trying everything, I looked for others files in my computer (Microsoft.Windows.Shell.dll) and found newer version, as expected by the Exception (3.5.41019.1) in MicrosoftRibbon for WPF\V3.5 folder.

It is strang,because the latest version of the NuGet package is 3.0.1.

Thanks anyway.

0
votes

Adding Microsoft.Windows.Shell.dll v3.5.41019.1 to your project references, would solve the problem.

0
votes

We had this problem when using the Ribbon control.

The solution was remove the ribbon: prefix from the very start of the XAML and use the default ribbon control, not the one that utilizes a namespace.