title: How to read data from MSMQ in C# ? (please note - Data is not written in C# )
body: <p>I am using nodejs, msmq and .net as technology stack in my project. I am collecting data from hardware using nodejs script and writing into MSMQ.
  I want to read this MSMQ in .net but I am getting below error.
  In addition I am not able to receive the message as well.  </p>
  
  <blockquote>
    <p>Error
          System.Xml.XmlException: Data at the root level is invalid. Line 1, position 
           at System.Xml.XmlTextReaderImpl.Throw(Exception e)
           at System.Xml.XmlTextReaderImpl.Throw(String res, String arg)
           'objMessage.ConnectorType' threw an exception of type 
           'System.InvalidOperationException'
           'objMessage.Body' threw an exception of type 'System.Xml.XmlException'</p>
  </blockquote>
  
  <pre><code>//Nodejs script
  const msmq = require('updated-node-msmq');
  const queue = msmq.openOrCreateQueue('.\\Private$\\EEG');
  queue.send(records);   
  </code></pre>
  
  <pre class="lang-cs prettyprint-override"><code>// C# code
  if (MessageQueue.Exists(@".\Private$\EEG")){
      objMessageQueue = new MessageQueue(@".\Private$\EEG");
  }
  objMessage = objMessageQueue.Receive();
  objMessage.Formatter = new XmlMessageFormatter(new Type[] 
       {typeof(Payload) });
  var message = (Payload)objMessage.Body;
  </code></pre>