title: using web.config variables within web.config
body: <p>I would like to have a variable defined in my web.config that I can use in multiple places within my web.config file (and other config files). It's probably easier to explain by example ...</p>
  
  <p><strong>web.config</strong></p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;configuration&gt;
      &lt;appSettings&gt;
          &lt;add key="AuthServiceEndPoint" value="any_old_name_i_like"/&gt;
      &lt;/appSettings&gt;
      &lt;system.web&gt;
  
      ...
  
      &lt;system.serviceModel&gt;
          &lt;client&gt;
              &lt;endpoint
                  address="net.tcp://localhost/AuthService"
                  binding="netTcpBinding"
                  contract="MyServices.Contracts.IAuthService"
                  name="#{AppSettings.AuthServiceEndPoint}"
                  bindingConfiguration="netTcpBindingConfig"
              /&gt;
  
          &lt;/client&gt;
      &lt;/system.serviceModel&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p><strong>windsor.config</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt;
  &lt;castle&gt;
      &lt;components&gt;
  
          ...
  
          &lt;component
              id="AuthProvider"
              service="MyServices.Client.IAuthProvider, MyServices.Client"
              type="MyServices.Client.AuthProvider, MyServices.Client"
              lifestyle="transient"&gt;
              &lt;parameters&gt;
                  &lt;endpoint&gt;#{AppSettings.AuthServiceEndPoint}&lt;/endpoint&gt;
              &lt;/parameters&gt;
          &lt;/component&gt;
  
      &lt;/components&gt;
  &lt;/castle&gt;
  </code></pre>
  
  <p>Is this possible?</p>
  
  <hr>
  
  <p><strong>Edit</strong> (a bit more information)</p>
  
  <p>I already have the ability to access the AppSettings from my windsor.config file (which is actually processed by castle windsor and a custom XmlInterpreter.</p>
  
  <p>The real question is can I do this in my web.config?</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;configuration&gt;
      &lt;appSettings&gt;
          &lt;add key="AuthServiceEndPoint" value="any_old_name_i_like"/&gt;
      &lt;/appSettings&gt;
      &lt;system.web&gt;
  
      ...
  
      &lt;system.serviceModel&gt;
          &lt;client&gt;
              &lt;endpoint
                  address="net.tcp://localhost/AuthService"
                  binding="netTcpBinding"
                  contract="MyServices.Contracts.IAuthService"
                  name="#{AppSettings.AuthServiceEndPoint}"
                  bindingConfiguration="netTcpBindingConfig"
              /&gt;
  
          &lt;/client&gt;
      &lt;/system.serviceModel&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p>ie - access variable in my <code>&lt;appSettings&gt;</code> from other parts of my web.config file.</p>