Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

System.Windows.Input doesn't exist?

Tags:

c#

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?

like image 626
Alper Avatar asked Oct 19 '11 16:10

Alper


2 Answers

go to manage Nuget Package Manager and install input simulator package and WindowsInput package and the issue will be resolved

like image 138
Sadaf Khursheed Avatar answered Sep 21 '22 10:09

Sadaf Khursheed


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.

like image 42
Jon Skeet Avatar answered Sep 18 '22 10:09

Jon Skeet