none
DotNet 2.0 Windows Service using MSMQ : System.Messaging.Message.Body error RRS feed

  • Question

  • Hi,

    I am facing this error long back.. Please help me in this regards...

    I have my .Net 2.0 Windows service to read the Priavate non transactions message queues and process into Sql Server 2005 database.....

    I have used threading concept too.. i have multiple queues to be read on regular basis...

    Getting below error exactly when reading the message body

    system.messaging.message mInput ;

    timespan tsInput = 1000;

    mInput = mqInput.Receive(tsInput);

          ActiveXMessageFormatter axFormatter= new ActiveXMessageFormatter();
          pubqloader.DMPMessage DMPmsg = new PubQLoader.DMPMessage();
          ActiveXMessageFormatter.InitStreamedObject(DMPmsg);
          object temp = new Object();
          temp = mInput.Body; --- here getting the error

    UnauthorizedAccessException Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))  

    Stack Trace1: when mInput.Body is used

    System.Messaging.Interop.NativeMethods.OleLoadFromStream(IStream stream, Guid& iid)
       at System.Messaging.ActiveXMessageFormatter.Read(Message message)
       at System.Messaging.Message.get_Body()

    Stack Trace2:  when mInput.Read() is used


    System.Object OleLoadFromStream(System.Messaging.Interop.IStream, System.Guid ByRef) System.Messaging  System.UnauthorizedAccessException: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
       at System.Messaging.Interop.NativeMethods.OleLoadFromStream(IStream stream, Guid& iid)
       at System.Messaging.ActiveXMessageFormatter.Read(Message message)

    I have all the permissions on queues and ...the service is registered with the same admin login

    Please help me out....

    Regards,

    Raju 

     


    Raju Balagam
    Monday, October 11, 2010 3:28 PM