Rahul Lodha
Rahul Lodha

Reputation: 3721

Unknown build error, 'Could not load file or assembly 'System.Windows

I am trying to build a test project for silverlight application. When i build this project it throws following error

Unknown build error, 'Could not load file or assembly 'System.Windows, Version=5.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)'

I have system.winwos dll in my references and i am using visual studio 2012.

What should i do to resolve this error

More Details:

If I remove system.windows.control.Navigation dll, this error no longer comes up but build requires system.windows.control.Navigation.

Upvotes: 2

Views: 8556

Answers (2)

Rahul Lodha
Rahul Lodha

Reputation: 3721

Finally found a system.windows version 5.0.5.0 in C:\Program Files (x86)\Microsoft Silverlight\5.1.20913.0 folder

Had to add this file manually in project.csproj file using tag Getting other build errors not but at least the this one is resolved.

Thanks for all your help!

Upvotes: 3

daustinash
daustinash

Reputation: 484

Generally when I've had this problem it's because my application is set to build 64-bit rather than AnyCpu and the offending assembly is 32-bit. Or vice versa.

Upvotes: 1

Related Questions