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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T18:44:12+00:00 2026-05-20T18:44:12+00:00

I have a WCF application that normally runs in IIS (for my testing and

  • 0

I have a WCF application that normally runs in IIS (for my testing and production environments). But when I run it from my debugger it is setup to run self hosted (that is, a console window pops up and IIS is NOT used).

I also have a client application that I connect to the WCF application. Normally when I am testing my client application (that runs on Windows Mobile) it is setup to connect to one of my testing environments (I have a development environment for me to test in).

The problem I am having now is that there seems to be a disconnect between what the client is sending and what the WCF application is getting. I need to debug my WCF application.

I can run my WCF application and then change the URL of my client to point the debugger version, but my services run with SSL and have a certificate that the client is hardcoded to expect.

I would rather not disable that part of my code (on the client). Is there a way to install the certificate on my self-hosted WCF application?

  • 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-20T18:44:13+00:00Added an answer on May 20, 2026 at 6:44 pm

    I just want to add some helpful information on how to programatically install an SSL certificate for a self-hosted WCF service. This does not cover how to get the WCF application to use the SSL certificate, since that is well-documented elsewhere on the web.

    This is intended to be run at setup time by an administrator, and not by the actual application itself, which in this example, runs under the limited Network Service account.

    • The code must run as an administrator.
    • Set the HTTP Namespace reservation
      programatically using the example in
      Programatically Granting a Namespace
      Reservation
      .
    • Set the SSL information
      programatically using the example in
      Changing the Certificate associated
      with IP address using
      HttpServiceConfiguration
      .

    You can then use those code samples to install and configure the certificate:

    if (!IsAdministrator())
    {
       Console.WriteLine("Must run "+
                    "as a user with local Administrator privileges.");
       Environment.Exit(-1);
    }
    
    //Open the cert.
    X509Certificate2 certificate = new X509Certificate2(certFilePath);
    
    //Add it to the local store
    X509Store certStore = new X509Store(StoreName.My, StoreLocation.LocalMachine);
    certStore.Open(OpenFlags.ReadWrite);
    certStore.Add(certificate);
    certStore.Close();
    
    //Reserve an HTTPS namespace for it.
    string urlPrefix = string.Format("https://+:{0}/{1}", portNum, appPath);
    ReserveHttpNamespace.ModifyReservation(urlPrefix, "Network Service", false);
    
    //Set the SSL cert for this service.
    SetSSLCert.BindCertificate("0.0.0.0", portNum, certificate.GetCertHash());
    

    You can then check that this ran correctly using the helpful HttpCfg UI Tool.

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

Sidebar

Related Questions

Hi i have a WP7 application that calls a wcf who runs with membership
I have a silverlight application that uses wcf service. This application is shown from
I have a silverlight application that runs WCF services. I have created a WCF
I have a WCF service that runs in my web application that provides data
I have an application that runs as a WCF webservice on IIS7. It calls
I have a WCF application that is using NetTcpBinding . I want to invoke
I have a WCF service and a Silverlight application that work just fine when
We have an application that has a WCF service (*.svc) running on IIS7 and
I have a application that's making calls against some WCF services I have hosted
I have a small application that uses WCF to communicate with a webserver. This

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.