System.Windows.Freezable is missing

DmitryBoyko picture DmitryBoyko · Mar 15, 2012 · Viewed 12.5k times · Source

I have got a Class Library project where I keep some interfaces and classes for my WPF Application and RIA Services.

Into the one of class I want to add a member

Brush BackgroundColor { set; get; }

or

SolidColorBrush BackgroundColor { set; get; }

But I got this error.

Error 2 The type 'System.Windows.Freezable' is defined in an assembly that is not referenced. You must add a reference to assembly 'WindowsBase, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.

What's up?

How to fix it if under Add Reference window I cannot see that assembly at all?

Answer

DmitryBoyko picture DmitryBoyko · Mar 15, 2012

The solution is simple. Just add references to the following three DLLs:

WindowsBase.dll

PresentationFramework.dll

PresentationCore.dll

In .Net 4.5, these DLL's typically reside in a directory with a name similar to: C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.5