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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T13:28:47+00:00 2026-05-13T13:28:47+00:00

I have a WCF host that listen to a topic and process incoming messages.

  • 0

I have a WCF host that listen to a topic and process incoming messages. the code look this:

 using (ServiceHost host = new ServiceHost(MessagingServiceType))
 {
               host.Open();
}

and the MessagingServiceType looks like that:

[ServiceBehavior(AddressFilterMode = AddressFilterMode.Any)]
    public class MessagingServiceType : IMessagingService
    {
        /// <summary>
        /// service instance
        /// </summary>
        private readonly MessagingService service;

        /// <summary>
        /// Initializes a new instance of the <see cref="MessagingServiceType"/> class.
        /// </summary>
        public MessagingServiceType()
        {
            // creating new messaging service
            service = new Singleton<MessagingService>();
        }

        /// <summary>
        /// Sends the message.
        /// </summary>
        /// <param name="messageContent">Content of the message.</param>
        public void SendMessage(string messageContent)
        {
            Message msg = Message.CreateMessage(MessageVersion.Default, string.Empty, messageContent);

            service.MessageReceived(msg);
        }
    }

The issue is that when i’m running it on a seperate test application, everything works fine and all the service receive all messages. However, when i take the exact same code and put it into my REAL application, no messages are being received.

my question is very simple: how can i “debug” this service to see what’s wrong with it and why messages are not being processed? is there anyway to compare between the two?

Thanks

  • 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-13T13:28:48+00:00Added an answer on May 13, 2026 at 1:28 pm

    Sure your service won’t receive anything…. just look at your code:

     using (ServiceHost host = new ServiceHost(MessagingServiceType))
     {
                   host.Open();
     }
    

    What exactly happens when you reach the “}” ?? The object in the “using” clause – your ServiceHost – will be freed / disposed of! ==> before you know it, your service is gone again…..

    You need to do something like:

    ServiceHost host = new ServiceHost(MessagingServiceType);
    host.Open();
    
    Console.ReadLine();  // wait for a ENTER press
    host.Close();
    

    No big debugging needed…….. 🙂

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

Sidebar

Related Questions

We have a .NET program that uses WCF to listen for communication from another
I have a WCF service that I have to reference from a .net 2.0
I have some WCF methods that are used to transmit information from a server
I have a WCF service, hosted in IIS 7.0 that needs to run database
I have a WCF Service that should not enter the faulted state. If there's
I am trying to host a WCF service, using NetTcpBinding in a Windows service.
I have a MSMQ application using WCF's netmsmqbinding. In the default configuration, and with
I am working on a Silverlight application that uses WCF. I need to have
I have a wcf application hosted in a windows service running a local windows
I have a WCF Web Service which is referenced from a class library. After

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.