.net-4.5

The type 'x' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Runtime...'


When I turned my project referencing to PCL assembly to .NET 4.5.2, I got compiler error: "The type 'System.Windows.Input.ICommand' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'." There are many such questions, but no one is not solve my problem.


Solution

  • That is a reported bug: https://connect.microsoft.com/VisualStudio/feedback/details/873446/project-targeting-4-5-2-fails-to-build-when-referencing-a-pcl.

    I choose .NET 4.5.1 target framework and error gone.