Marc Canals Giraut
Marc Canals Giraut

Reputation: 354

Could not load file or assembly 'System.Windows.Controls' in silverlight 5 using prism4

I'm creating an application silverlight 5 using prism 4 and when I'm running the bootstrapper using UnityBootstrapper then I have the next error:

Could not load file or assembly 'System.Windows.Controls, Version=2.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.

This error in the ConfigureRegionAdapterMappings method:

    protected override RegionAdapterMappings ConfigureRegionAdapterMappings()
    {
        // Call base method
        var mappings = base.ConfigureRegionAdapterMappings(); <-- I get the error here!
        if (mappings == null) return null;

        // Add custom mappings

        // Set return value
        return mappings;
    }

The strange thing is if I change my project to silverlight 4 then it is working fine (?). Could you please help me?

Thanks!

Upvotes: 4

Views: 1516

Answers (1)

yrahman
yrahman

Reputation: 950

this is because prism 4 libraries are targeting silverlight 4. you have to download the source code of prism and have to change all silverlight project references to silverlight5 and the recompile it and then set references to new binaries

Upvotes: 6

Related Questions