I've cobbled together a Windows Class Library (Called MPC_Core) using .NET 4, I'm referencing this class library within a Windows Phone 7.1 application.
I'm creating and initialising the ObservableCollection object (Contained within the Locationmanipulator class) like so:
From here I provide the following property which allows access to the field:
Within the WP7.1 application (After referencing it via the "Add References" dialog) I initialise the LocationManipulator object:
When I come to use access the ObservableCollection field within LocationManipulator, I receive the following error:
Additionally I can see the following messages within the error list:
How would I resolve this issue? I've tried to make sure everything is up to date (Silverlight, VS2010) and that I've used the correct references for each object type.
Many thanks.
You're not supposed to reference a Windows library from a Silverlight app. You have this error because the library references the .NET 4.0's ObservableCollection, while your app references the Silverlight one.
If you want to use this library, you have to recompile it for Silverlight. I don't think there's an easy way to do this. Create a new Silverlight library project, add the files, compile, and pray for not having to modify too large portions of code.