-1

I am getting following error when i am trying to build my c# project:

The type or namespace name xyz could not be found (are you missing a using directive or an assembly reference?)

I have given reference of required file . don't know why this error is coming again and again?

Thanks in advance

Soner Gönül
  • 97,193
  • 102
  • 206
  • 364
shubhendu
  • 213
  • 1
  • 3
  • 10

1 Answers1

0

You probably need the using directive too. In the file that is throwing the error, add:

using xyz;

Obviously substituting xyz with the correct namespace.

DGibbs
  • 14,316
  • 7
  • 44
  • 83
  • Try cleaning and then rebuilding your entire solution - it may be that the `using` directive is needed in other files too... – DGibbs Dec 16 '13 at 09:22
  • Cleaned and rebuild but nothing improved .. still shoeing same error..!! – shubhendu Dec 16 '13 at 09:28
  • Can you post the full error message, and then the `using` block from the file that is referencing? – DGibbs Dec 16 '13 at 09:34
  • yes... here it is: _Error 2 The type or namespace name 'SensorControl' could not be found (are you missing a using directive or an assembly reference?) C:\Documents and Settings\Anita\My Documents\Visual Studio 2010\Projects\WFM2_V1.6\WFM2_V1.6\settingFrm.cs 12 7 WFM2_V1.6_ and using block is **using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using System.Threading; using SensorControl; using SensorControl.Sensors; using PaintAnalysis.Common;** – shubhendu Dec 16 '13 at 09:36
  • Could be that the project has the wrong [client profile](http://stackoverflow.com/questions/4764978/the-type-or-namespace-name-could-not-be-found?rq=1) – DGibbs Dec 16 '13 at 09:55
  • It's explained in the link I provided. – DGibbs Dec 16 '13 at 10:14