1

I want to store the HttpClient BaseAddress Uri on my ASP.NET MVC4 project web.config.

In which section is the correct place to add this configuration?

Erik Philips
  • 53,428
  • 11
  • 128
  • 150
Hugo Hilário
  • 2,848
  • 2
  • 27
  • 43

1 Answers1

2

Add this in web.config

<configuration>
  <appSettings>
    <add key="BaseAddress" value="http://xxx/"/>
  </appSettings>
</configuration>

Get value like this:

ConfigurationManager.AppSettings["BaseAddress"]
Zack Yang
  • 399
  • 2
  • 11