I am trying to share a bit of code between a silverlight application and a WPF application.
I've created a new portable class library project, and set it to target ".NET Framework 4 and higher" plus "Silverlight 4 and higher".
However, when I create a WPF project (targeting .NET framework 4), and add a reference to the PCL, I get a message saying:
"References between projects that target different runtimes or .NET Framework profiles are not supported. This reference will be treated as a file assembly reference."
This is annoying because it should be targeting the same runtime and profile.
And what that means is that I can't hit my beloved F12 to jump from my WPF code into the class inside my PCL.
Is it possible to fix this or am I trying to do the impossible?
This is a known limitation when using Visual Basic and attempting to add a project-to-project reference between different "frameworks". Unfortunately, there is no workaround.
While this may seem strange, to the Visual Basic compiler - portable and .NET Framework have different mscorlibs and different surface area, and it cannot share the context that feeds F12 and the like between them.
While this won't help you now, Roslyn will eventually remove these kinds of restrictions.