Missing reference to System.ObjectModel

Topics: Prism v4 - WPF 4
Oct 24, 2014 at 7:57 PM
Edited Oct 24, 2014 at 8:27 PM
I recently started a project using Prism 5.0.0 with Prism.UnityExtensions 5.0.1 and Unity 3.5.1404.0 (all installed from Nuget). This is a project targeting .NET 4.5.1.

As soon as I make a ViewModel inherit BindableBase, the compiler throws this error:
Reference required to assembly 'System.ObjectModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' containing the implemented interface 'System.ComponentModel.INotifyPropertyChanged'. Add one to your project.
Strange thing is I have a similar previous project, with the same version of Prism, Prism.UnityExtensions and Unity, which is also targeting .NET 4.5.1 which doesn't have this problem.
So, I'm stuck.
Does anyone have an idea why this is happening?

I've seen this post: https://compositewpf.codeplex.com/discussions/552527
But according to it, I should not experience the issue with .NET 4.5.1. That's the reason I created this new post.
Oct 25, 2014 at 7:33 AM
OK this is crazy. The project with the above problem was originally targeting .NET 4.0. I changed it's properties to target 4.5.1, and added prism. That caused the above issue.

I then decided to try and create a new project (directly targeting 4.5.1) and added it to the same solution. Then copied all the files from the original project to the new project, set the same references on the new project as the original project. And the compiler is now happy!

So, problem solved, although I don't know what was wrong.