tags:

views:

43

answers:

2

After importing an older C# file into a new WPF appliction, "using System.Windows;" gives an error message. This wasn't just one C# file, it was a number of them and I put them into a new project.

What reference do I need to locate or change to get using System.Windows to resolve properly?

A: 

This problem stems from resources which are associated at the Project level (References), which I had not added to the new project.

To use old code unchanged, I can add a Reference to System.Drawing, and use the old Windows Forms framework.

If I want to convert the code to WPF, I need to add an association (Reference) to the new project. I can get using System.Windows; to work by adding a Reference in the new project to "PresentationFramework".

Fred
+2  A: 

Add a reference to System.Drawing for your project.

JP Alioto
I think I'd rather update his library to use WPF functionality instead, but that's definately useful information.Thanks!
Fred