MessageQueue.Create fails when my app is a service RRS feed

  • Question

  • My app runs fine when it is a regular app, and not a service. But when I install it as a service, the service gets installed ok with no problems, and starts with no problems, but MessageQueue.Create fails. (I get an access denied, when I try to "create" (really open an existing queue) a queue.

    Again, opening an existing message queue works fine when it's a regular app, but not as a service. I know there are differences in privileges between service and regular app...but not sure how to fix this issue.

    If I create a queue from scratch in service (ie create a new one that does not exist, rather than opening one that exists)
    I can do that, but then other apps that are not services can not access message queue that the service created because they don't have the same privilege/access rights that the service has (apparently the service has higher privileges than a normal app).

    How to fix these issues??

    Wednesday, March 19, 2008 11:59 AM


  • The user account the service runs under is probably different then yours.  If you create the queues ahead of time you can go into computer management and change the permissions of the queues.  You can give read/write permission to multiple users.  You could also change the user that the service runs under.  Just open up the service mmc snap in and right right click on the service and select properties.  The second tab "Log On" will let you change the user.
    Friday, March 21, 2008 6:01 AM