Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

System.Windows.Freezable is missing

Tags:

c#

class

wpf

dll

brush

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?

like image 365
Friend Avatar asked Mar 15 '12 19:03

Friend


1 Answers

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

like image 114
Friend Avatar answered Sep 22 '22 06:09

Friend