1
 public static ModbusMasterSerial mm;

I'm Getting Error : the type or namespace name 'ModbusMasterSerial' could not be found (are you missing a using directive or an assembly reference?)

I have already added reference of Modbus in reference section. and I'm using that by adding using Modbusto my code. but still getting the same error.can you tell which is appropriate reference for ModbusMasterSerial?

  • Do you have the using directive? – Drag and Drop Jun 20 '17 at 06:41
  • add usinig [namespace] click the error than {ALT} + {.} and you get the list of options to fix this choose the first – Timon Post Jun 20 '17 at 06:41
  • You probably have a typo. Verify the variable is typed correctly. The other reason for issue is the variable is defined in a different section of the code. – jdweng Jun 20 '17 at 06:42
  • You say you added the reference by adding a using. But you also need to add the assembly (possibly a dll) und references in the project explorer. Additionally, you need to add the using in every file you want to access types from the assembly. – Romano Zumbé Jun 20 '17 at 06:56
  • Reference and using is 2 differente thing. Ref are like the book you have in on your shell. Using is link to page of those book. You can't expect a link to book that you don't have to work. – Drag and Drop Jun 20 '17 at 06:58

1 Answers1

0

Add the appropriate using directive for ModbusMasterSerial.

click on the ModbusMasterSerial.And type ctrl + . It will show you some options.Add appropriate namespace from there.

Reshma
  • 436
  • 3
  • 13