Problem with the Receive () method using Microsoft Message Queue

0

I have a problem in the following code where I used an MSMQ queue:

Message m;
if (t! = TimeSpan.Zero)
{
m = q.Receive (t);
}
plus
{
m =

q.Receive ();
}

What I am doing is consuming a web service that uses this code. The problem is that if I test it locally using the Visual Studio debugger it works. But when I send the message using the service that is deployed in the IIS, when the Receive () method is executed it returns a TimeOut error, apparently due to the lack of permissions.

System.Messaging.MessageQueueException (0x80004005): The timeout for the requested operation has expired

Investigating I think it could be because when using debugger the user who accesses the queue is the one who encounters the session started on the computer. And when the consumption from the service URL the user who accesses is the IIS / DefaultAppPool. But I'm not sure, and I can't make it work, if anyone has any idea of ​​how qualitative the solution would be, I appreciate it in advance.

I am working on Windows Server 2016 with .NetFramework 4.8.

c#
.net
message-queue
windows-server-2016
asked on Stack Overflow Sep 5, 2019 by Matias • edited Nov 6, 2019 by Stephen Kennedy

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0