Alex Rivera | Logout

System.Windows.Input doesn't exist?

Asked 2011-10-19T16:05:44.830
15

I have using System.Windows.Input; at the top of my program, but it gives me an error saying that:

The type or namespace name 'Input' does not exist in the namespace 'System.Windows' (are you missing an assembly reference?)

And when I let IntelliSense popup on the period right after Windows it only lists Forms as a valid option. I'm using .NET framework 4.0 in Visual C# 2010 Express...

How can I fix this problem?

c#
Edit
Report

1 Answer

18

I suspect you've created a Windows Forms project, instead of a WPF project.

The types contributing to System.Windows.Input are in PresentationCore.dll and potentially other WPF-related assemblies.

I don't know enough about the types in System.Windows.Input to say for sure whether or not you can use them in a Windows Forms app, but I would at least encourage you to decide whether to go with Windows Forms or WPF, and then use types designed for that UI platform.

answered 2011-10-19T16:07:01.427

Your Answer