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 8172979
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T21:58:14+00:00 2026-06-06T21:58:14+00:00

I have an assembly DLL that lets me connect to an ActiveMQ broker. Using

  • 0

I have an assembly DLL that lets me connect to an ActiveMQ broker. Using the DLL from NUnit works fine and using it from a Console app works fine too. The problem is using it from a Windows Service. The connection to the broker always fails, as if there’s no external connectivity available to the service. Even bypassing the SCM and running the code in Visual Studio fails. Is there anything special a Windows Service project needs to do to get external connections?

The failing code in the DLL is this:

ConnectionFactory connectionFactory = new ConnectionFactory(connectURI);
connection = connectionFactory.CreateConnection(); // fails here

the connectURI is fine as it works in the Console app and the tests.

  • 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-06-06T21:58:16+00:00Added an answer on June 6, 2026 at 9:58 pm

    The main differnce is a console app and NUnit is running as the logged on user. A windows service runs as whatever you configure it to run as.

    Try configuring the service to run as your account and see if it works. Make sure it’s not running as network service or local service.

    The account it’s running as may need a user profile (has logged on before) especially if using a proxy server.

    Try running fiddler or netmon to see what’s going on in the attempted connection. Also, try adding some logging and tracing around the connection attempt – the exception stack should have more details.

    EDIT from comments: Also try adding .net web client connect code which will give a better insight into whatever connectivity issue there is. Obviously NMS is masking and swallowing the root issue.

    EDIT: for others looking for the solution (without reading all the comments), adding the .web client code exposed the root issue which was a config file issue.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a .NET assembly DLL that is created on-the-fly from pre-compiled code in
I have a .NET application that uses an assembly (.dll) that defines some method:
I have a dll that contains a number of classes that all inherit from
Sorry about the terrible title. I have a signed assembly 'Signed.dll' that is a
I have a C# Silverlight app that lets the user select which spreadsheet they
I have a C# .dll that is envoked from within a C# application useing
I have an assembly called A.dll that has a project reference to an assembly
I have a very modest application with a single external assembly (log4net.dll) that I
I have a COM Interop DLL that I'm automatically generating from an existing COM
I have created a DLL that will gather information from the AssemblyInfo.cs. In the

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.