Click here to Skip to main content
13,097,926 members (57,694 online)
Rate this:
Please Sign up or sign in to vote.
I have two WCF services, which use the net.msmq protocol and hosted in IIS 7.
My problem is that the services do not activate when a new message appears on the queue. We have to manually browse the services first before they start picking up any messages.

Is there any way to auto activate these services?

Thanks in advance for any help.
Posted 11-Jul-13 0:55am
Updated 11-Jul-13 2:03am
Mohammed Hameed 11-Jul-13 8:06am
Though it is a good question but I suggest you to try solving yourself. For this, you might have to understand how MSMQ works in Wcf.
saumil.sapariya 11-Jul-13 8:14am
I should notice that it appears when application pool (IIS) recyled.If you have suggestion plz provide :)

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

This is do-able with the combination of .Net 4 and IIS7.5.

First you need to auto start the application pool.

Configure Automatic Startup for an Application Pool (IIS 7)[^]

Then you need to configure the application to auto start:

Auto-Start ASP.NET Applications (VS 2010 and .NET 4.0 Series)[^]

If you don't have access to these components then you'll be required to keep the application alive by other means. Such as the following code snippet in a windows service:

WebClient refresh = new WebClient();
try {
    refresh.UploadString("", string.Empty);
catch (Exception ex) {
finally {

Which I got from this article, discussing the keep alive problem.

Keep Your Website Alive (Don’t Let IIS Recycle Your Website)![^]

There are a number of settings on the IIS application pool which control recycling of the worker processes.

Understanding these can also help reduce the number of times the application shuts down.

Recycling Settings for an Application Pool[^]

Although if you want my advice. I'd completely drop IIS and develop a self hosted WCF application. Then the problem will just disappear.

How to: Host a WCF Service in a Managed Application[^]

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web01 | 2.8.170813.1 | Last Updated 11 Jul 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100