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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T05:22:42+00:00 2026-05-19T05:22:42+00:00

I am developing a WCF Service in VS 2010 and .NET 4.0. I am

  • 0

I am developing a WCF Service in VS 2010 and .NET 4.0.

I am creating the app.config file and I want to specify once the base address for the server.

I’ve declared it into the appConfig section as:

<appSettings>  
  <add key="base_address" value="net.tcp://localhost:5050/Service1/"/>
</appSettings>

I would like to know how can I reference that key into the service/host/baseaAddressses like:

<service
    name="WcfService_callbacks_tcp_auth_username.Service1"
    behaviorConfiguration="beh_auth">
    <host>
      <baseAddresses>
        <add baseAddress="!!!here_the_key!!!"/>
      </baseAddresses>
    </host>
</service>

And in the client/endpoint section like:

<client>
  <endpoint address="!!!here_the_key!!!" binding="netTcpBinding"
            bindingConfiguration="NetTcpBinding_IService1" contract="Service1.IService1"
            name="NetTcpBinding_IService1">
            <identity>
                <certificate encodedValue="..." />
            </identity>
   </endpoint>
</client>

Is there anyway to do this?

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-19T05:22:43+00:00Added an answer on May 19, 2026 at 5:22 am

    You cannot do that out of the box.

    Either you specify the base address explicitly in your WCF config

    <service
        name="WcfService_callbacks_tcp_auth_username.Service1"
        behaviorConfiguration="beh_auth">
        <host>
          <baseAddresses>
            <add baseAddress="net.tcp://localhost:5050/Service1"/>
          </baseAddresses>
        </host>
    </service>
    

    or you read it from the app.config in code and set it in WCF code (sample for client side – on the service side, you need to call .AddServiceEndpoint() on your ServiceHost):

    string customBaseAddress = ConfigurationManager.AppSettings["base_address"];
    
    YourServiceClient proxy = 
         new YourServiceClient("NetTcpBinding_IService1",  // endpoint name in config
                               customBaseAddress);         // custom URL
    

    You cannot reference another config settings inside app.config – the .NET config system just doesn’t support that.

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

Sidebar

Related Questions

I am currently developing a service with wcf 4.0 (visual studio 2010 RC). When
My group is developing a service-based (.NET WCF) application and we're trying to decide
I've been developing a WCF web service using .NET 3.5 with IIS7 and it
I'm using .NET 3.5 and WCF for developing a server-client application. Binding=BasicHttp. I'm working
I am developing a WCF service designed to be consumed by non .NET clients,
I am developing a RESTful WCF service which I then want to consume from
I am developing an application which includes a WCF service and its ASP.NET MVC
I'm developing a WCF Data Service to expose a database. I want to provide
I am currently developing a WCF publish subscribe service for my asp.net publisher and
i am currently developing a wcf publish subscribe service. On my windows form app,

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.