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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T07:47:21+00:00 2026-06-15T07:47:21+00:00

I have a WCF hosted on Azure (WebRole). That WCF does a lot of

  • 0

I have a WCF hosted on Azure (WebRole). That WCF does a lot of background tasks and replies to some petitions.

The problem is that if the WCF doesn’t receive any petition for a long time (10 hours or more) the application pool is recycled on the azure instance and the WCF tasks stops. I did a little investigation an I can enable a AutoStart feature touching the machine.config, but this is not an option with a azure deploy.

Can I enable AutoStart within web.config or deploy config files?

  • 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-15T07:47:25+00:00Added an answer on June 15, 2026 at 7:47 am

    You can add some code in the WebRole.cs to modify the application pool:

    public class WebRole : RoleEntryPoint
    {
        public override void Run()
        {
            using (var serverManager = new ServerManager())
            {
                var mainSite = serverManager.Sites[RoleEnvironment.CurrentRoleInstance.Id + "_Web"];
                var mainApplication = mainSite.Applications["/"];
                var mainApplicationPool = serverManager.ApplicationPools[mainApplication.ApplicationPoolName];
                mainApplicationPool["autoStart"] = true;
                mainApplicationPool["startMode"] = "AlwaysRunning";
    
                serverManager.CommitChanges();
            }
    
            base.Run();
        }
    
        public override bool OnStart()
        {
            // For information on handling configuration changes
            // see the MSDN topic at http://go.microsoft.com/fwlink/?LinkId=166357.
    
            return base.OnStart();
        }
    }
    

    Note: To use ServerManager you will need to:

    • reference C:\Windows\system32\inetsrv\Microsoft.Web.Administration.dll (or available through NuGet)
    • add <Runtime executionContext="elevated" /> in your Service Definition under the WebRole element
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a WCF application hosted as a webrole in Azure with the following
Have a bunch of WCF REST services hosted on Azure that access a SQL
I have hosted a WCF service on Azure at http://voraservice.cloudapp.net/MyPushService.svc . The problem is
I have a WCF service hosted in IIS 7. It takes some minutes until
We have created a WCF service hosted in a windows service that handles Authentication
I have a WCF Data service hosted in Azure as a Azure Web Role.
I have a WCF Service hosted on Windows Azure and I just recently changed
I have hosted one WCF Service on the Azure platform and in web.config enabled
I have some console applications that communicate using WCF over TCP. Is it possible/easy
I have WCF service that is IIS-hosted and I have to send binary data

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.