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?

有帮助吗?

解决方案

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.

其他提示

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.

If you are using VS.NET:

  1. Right click on the References folder on your project.
  2. Select Add Reference.
  3. Select the .NET tab (or select the Browse button if it is not a .NET Framework assembly).
  4. Double-click the assembly containing the namespace in the error message.
  5. Press the OK button.

If you are using the command line, use the /r: or /reference: option. For Example:

csc.exe /reference:System.Drawing.dll MyFontDisplayApp.cs

When you recompile, this error will no longer appear.

It is also possible that your project uses x64 libraries and your machine has limited x64 libraries. I think this happened in my case. Possible Solution: I copied library from x86 folder to bin folder of my project. Then added the new reference(discard the old reference to same library). AND IT WORKED. Note: Please correct me if I am wrong here.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top