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

  • Home
  • SEARCH
  • 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

I installed ActiveReports from their site. The version was labeled as .NET 2.0 build
I installed CruiseControl.net ( from the CruiseControl.NET-1.4-Setup.exe installer ) on my Vista x64 development
I installed the ReSharper evaluation version and uninstalled it. Afterwards Visual Studio's Intellisense stopped
I installed Perforce plugin version 3.4 on Eclipse Ganymede, configured my connection and workspace.
Installed PEAR and followed the directions on http://www.phpunit.de/manual/current/en/installation.html : pear config-set auto_discover 1 pear
I installed the playframework fbconnect module (version 0.6). I keep getting the following error.
Installed a captcha on my blog, been good up until now. There have recently
I have a Visual Studio extension (CustomTool) that depends on NLog for logging. I'd
I installed GitHub on mac but I don't have installed git on terminal. When
Installed the official FB app for the emulator, and logged in. Generated a working

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.