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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T17:45:18+00:00 2026-05-12T17:45:18+00:00

I have created a WCF service which does not use the app.config to configure

  • 0

I have created a WCF service which does not use the app.config to configure itself. However, it takes three to four minutes on some PCs to construct the ServiceHost object. Thinking there was something wrong with my service, I constructed a simple Hello, World service and tried it with that. I have the same issue.

According to the profiler, all this time is spent reading in configuration for the service.

So I have two questions really.

  1. Is it possible to disable reading config from the XML?

  2. More importantly, does anyone have any idea why this might be taking such an inordinate amount of time?

Here is the sample service:

[ServiceContract]
public interface IMyService
{
    [OperationContract]
    string GetString();
}

[ServiceBehavior(InstanceContextMode=InstanceContextMode.Single)]
public class MyService : IMyService
{
    public string GetString()
    {
        return "Hello, world!";
    }
}

class Program
{
    static void Main(string[] args)
    {
        Uri epAddress = new Uri("http://localhost:8731/Test");
        Uri[] uris = new Uri[] { epAddress };

        MyService srv = new MyService();
        ServiceHost host = new ServiceHost(srv, uris);  // this line takes 3-4 minutes

        host.AddServiceEndpoint(typeof(IMyService), new WSHttpBinding(), "Test");
        ServiceMetadataBehavior smb = new ServiceMetadataBehavior();
        smb.HttpGetEnabled = true;
        host.Description.Behaviors.Add(smb);

        host.Open();

        return;
    }
}

I need for design reasons to create the service and pass it in as an object, rather than passing it in as a type.

If there’s any more information that can be of use, please let me know.

Many 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-12T17:45:19+00:00Added an answer on May 12, 2026 at 5:45 pm

    Is the server connected to the internet?

    If not, try the following:

    1. Open Internet Explorer
    2. Tools -> Internet Options -> Advanced Tab
    3. Scroll down to Security and disable ‘Check for publisher’s certificate revocation’
      and ‘Check for Signatures on downloaded programs’

    In some cases doing this speeds up lots of seemingly unrelated processes on your PC, including communication and startup speed of different ms programs (especially Visual Studio).

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

Sidebar

Related Questions

I have created a WCF service which returns IEnumerable<CyberResourceProvisioningAction> . The CyberResourceProvisioningAction type has
I have a Silverlight application that communicates to a Silverlight-enabled WCF service, both of
I have a call to a SOAP WCF Service that returns a lot of
I have the following situation (outline): Authorization Webservice This service gets called and verifies
I have to create a simple app, that will suit as an example of
In other words: How to change wcf service contract to remove additional message's wrapper
I have a Visual Studio 2010 solution that is set to build in Debug
https://tbe.taleo.net/MANAGER/dispatcher/servlet/rpcrouter the above is from Taleo's API guide. I'm trying to create a WCF
So I've been banging my head against the wall for the past couple days
I'm curious as to see how most developers go about designing the contracts to

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.