Could not load file or assembly in WPF project

Check the property page of the reference. There should be an option Copy Local, set it to true This will copy the assembly to the output directory at build-time.

This will copy the reference to the debug path, which is required if the targetted assembly is not in the GAC or loaded with a specified path.


As @StayOnTarget perfectly mentions, while this might work, it is not always the best solution because it might mask another miss configuration - specifically when dealing with framework references.

See When using PresentationFramework.Aero, do I need to set "Copy Local" to true (and include it in my setup project)? for this scenario.