I have a WPF.NET 4.0 class library referencing a Silverlight 4 class library.
The SL library compiles fine, but when I compile the WPF class library, I get:
Error 2 Unknown build error, 'Cannot resolve dependency to assembly 'System.Windows, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e' because it has not been preloaded. When using the ReflectionOnly APIs, dependent assemblies must be pre-loaded or loaded on demand through the ReflectionOnlyAssemblyResolve event.' MyProj.Presentation.Wpf
I believe the problem should be similar to the one mentioned here: http://markti.spaces.live.com/blog/cns!D92CF278F0F91957!273.entry
but my WPF library does not contain XAML, which refers to a user control from my SL library. In fact, my SL library does not have XAML at all. However, it has several common DependencyObjects objects, such as EventCommander (binding events of the UI element to commands) and some DataTemplate helpers.
Can I narrow down the problem here? And has anyone found a way to efficiently reference user interface elements in an SL4 project with .NET 4.0?
Thanks.
source share