Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The type or namespace name 'Device' does not exist in the namespace 'System'

Tags:

namespaces

c#

I am trying to work with GeoCoordinate which is meant to be supported by .Net Framework 4.5. I am working on winodws 8 and I have .Net Framework 4.5, but I keep getting The type or namespace name 'Device' does not exist in the namespace 'System' error.

Any solution?

like image 869
Mehraban Avatar asked Nov 30 '22 19:11

Mehraban


2 Answers

Does not have added reference of System.Device dll in your project.

Steps to Add Reference.
1. Right click on the Reference folder on your project.
2. Select Add Reference.
3. Expand Assemblies option.
4. Search System.Device in the serach box at right corner side.
5. After searching, click on checkbox to select and click on ok.

like image 38
Gobind Gupta Avatar answered Dec 06 '22 20:12

Gobind Gupta


The type or namespace name 'XXX' could not be found...

Always bear in mind, if you get this error there are three possibilities.

  1. You missed the using directive.
  2. You missed the Assembly reference
  3. You have "using directive" as well as "Assembly reference" in place but the current project's target framework version is lower than the referenced assembly target framework version.

Almost all the cases above three steps should solve the problem.

Hope this helps.

like image 101
Sriram Sakthivel Avatar answered Dec 06 '22 19:12

Sriram Sakthivel