Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6615255
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T20:26:24+00:00 2026-05-25T20:26:24+00:00

I installed NLog version 2 and sending to a remote MSMQ is not working.

  • 0

I installed NLog version 2 and sending to a remote MSMQ is not working. Do I have the config setup properly?

  <nlog autoReload="true" xmlns="http://www.nlog-project.org/schemas/NLog.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <targets>
      <target xsi:type="MSMQ" name="MSMQLog" useXmlEncoding="true" queue="FormatName:DIRECT=OS:server01\private$\test_log" recoverable="true" />
    </targets>
    <rules>
      <logger name="*" minlevel="Trace" writeTo="MSMQLog" />
    </rules>
  </nlog>

I installed MSMQ on my local box and the server I’m sending the message too. NLog doesn’t throw any exceptions (they are turned on). I don’t see anything in the outgoing mailbox on my local machine.

I am able to send to the queue by using the following code.

using (var queue = new MessageQueue(@"FormatName:DIRECT=OS:server01\private$\tasi_log")) 
                { 
                    var message = new Message("TEST"); 
                    message.Formatter = new BinaryMessageFormatter(); 
                    queue.Send(message); 
                } 

Does NLog work with remote queues?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T20:26:25+00:00Added an answer on May 25, 2026 at 8:26 pm

    So I tried sending to a public queue and it still didn’t work using NLog. So, I looked at the NLog.Extended source code and I found this method.

    protected override void Write(LogEventInfo logEvent) 
            { 
                if (this.Queue == null) 
                { 
                    return; 
                } 
    
                string queue = this.Queue.Render(logEvent); 
    
                if (!MessageQueue.Exists(queue)) 
                { 
                    if (this.CreateQueueIfNotExists) 
                    { 
                        MessageQueue.Create(queue); 
                    } 
                    else 
                    { 
                        return; 
                    } 
                } 
    
                using (MessageQueue mq = new MessageQueue(queue)) 
                { 
                    Message msg = this.PrepareMessage(logEvent); 
                    if (msg != null) 
                    { 
                        mq.Send(msg); 
                    } 
                } 
            } 
    

    I commented out the following if statement and it now sends to remote queues. Can someone verify this? Is this a bug, or am I missing something?

    if (!MessageQueue.Exists(queue)) 
                { 
                    if (this.CreateQueueIfNotExists) 
                    { 
                        MessageQueue.Create(queue); 
                    } 
                    else 
                    { 
                        return; 
                    } 
                } 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Installed rubyinstaller-1.8.7-p358.exe, then tried to install jammit , but the config.gem command isn't being
I installed the latest version of Wordpress and added the WP-Syntax plugin (and also
I installed the trial version of VSTS 2010 Beta 1, and I want to
I installed the playframework fbconnect module (version 0.6). I keep getting the following error.
I installed Google Chrome Portable on the user's desktop and have the default homepage
Installed PEAR and followed the directions on http://www.phpunit.de/manual/current/en/installation.html : pear config-set auto_discover 1 pear
Installed the Web Tools Platform 3.3.0 plugin for Eclipse but components are not available
Installed a captcha on my blog, been good up until now. There have recently
I installed the Zend Framework, but I have a big problem here. When I
I installed the newest version of Adobe Photoshop. The newer CS6 Photoshop COM object

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.