7

I am using Visual Studio 2008 with the .NET Framework (v3.5). I cannot seem to use System.Windows.Shapes, or anything System.Windows.* besides Forms.

Here is the link to the class description:

System.Windows.Shapes (MSDN Library)

Is there some special thing I need to do to use it?

I checked in all of the framework folders, and the only dll/xml files I have for System.Windows is System.Windows.Forms.

What do I need to do to get this to work?

Joe Fontana
  • 2,306
  • 3
  • 18
  • 18
  • 2
    Shapes is a WPF library, if you have forms available but not shapes then you are probably using a Winforms project, while it is possible for import the WPF libraries into winforms you will probably not be able to use them as you expect – MikeT Jul 12 '16 at 10:12

5 Answers5

14

This class is part of WPF, from MSDN:

Shape Class

Assembly: PresentationFramework (in presentationframework.dll)

Julien Roncaglia
  • 17,397
  • 4
  • 57
  • 75
8

You need to add a reference to the PresentationFramework library.

In VisualStudio, right click on your project in the "Solution Explorer". Select "Add Reference". The "PresentationFramework" library will be under the ".NET" tab. You may also need to add "PresentationCore" and "WindowsBase".

You can see your project's current library references by going to the "Solution Explorer" and expanding the "References" item.

Zach Garner
  • 2,009
  • 1
  • 16
  • 6
3

You may need to add a reference to the library, probably System.Windows.Presentation

Edit: It is in the PresentationFramework library

benPearce
  • 37,735
  • 14
  • 62
  • 96
2
  1. Add reference to PresentationFramework from .Net tab
  2. write using System.Windows.Shapes

and you are done!

kleopatra
  • 51,061
  • 28
  • 99
  • 211
sstauross
  • 2,602
  • 2
  • 30
  • 50
2

Other solution that works in .Net 4.0: Go to referenes->add reference and choose PrsentationFramework under .NET tab.