0

My code there is a errors like

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

How I correct this.please give your help.

class ProcessCSV
    {
        public static string dateFormatString = "dd/MM/yyyy HH:mm:ss";
        private string prefix = "";
        ChannelData[] channelData = new ChannelData[4];

        private ChannelData[] loadChannelData(string[] valuesInCsvLine)
        {
            channelData[0] = new ChannelData();
            channelData[1] = new ChannelData();
            channelData[2] = new ChannelData();
            channelData[3] = new ChannelData();
      }
   }
  • If Wasim's advice doesn't help, you could include the code for `ChannelData` and also add in `ProcessCSV`s namespace –  Jul 06 '17 at 10:42
  • @Kartoffel can you say where I add this – user8235318 Jul 06 '17 at 11:48
  • What I mean is: you didn't include the reference/assembly in your code snippet. You can click on edit below the tags and give use something like `namespace whereChannelDataIs{ class ChannelData{ //your code here } }` and `namespace whereProcessCSVIs { class ProcessCSV{ //the code you posted above } }`. That way we can tell if you need to include the namespace when refering to the type or a using directive. Also to check for Wasim's answer, go to each projects' properties and compare the framework versions. –  Jul 06 '17 at 11:56
  • @Kartoffel thank you sir,I will try – user8235318 Jul 06 '17 at 12:16

1 Answers1

0

There is .Net framework incompatibility issue between your projects. The project consisting of type ChannelData can be of different version than that of your current project.

Sometimes it is also a client profiling issue. Make sure that both the projects are using the same .Net framework.

If you are using ChannelData from external assembly or dll, then you can right click on ChannelData and just goto definition. It will show you the version and you can match it with your current project (if it's convenient to you).

But if you are not having the above issues then sometimes cleaning and rebuilding your solution simply helps. You can also restart your visual studio. Hope it helps you.

Wasim
  • 41
  • 4
  • [Another explanation for that](https://stackoverflow.com/a/3304899/8098743) –  Jul 06 '17 at 10:57