Asp.net mvc 4 在web.config上存储HttpClient基地址

Asp.net mvc 4 在web.config上存储HttpClient基地址,asp.net-mvc-4,asp.net-web-api,Asp.net Mvc 4,Asp.net Web Api,我想在我的ASP.NET MVC4项目web.config上存储HttpClient基地址Uri 在哪个部分中添加此配置是正确的?在web.config中添加此配置 <configuration> <appSettings> <add key="BaseAddress" value="http://xxx/"/> </appSettings> </configuration> 请务必注意以下事项: Configurat

我想在我的ASP.NET MVC4项目web.config上存储HttpClient基地址Uri

在哪个部分中添加此配置是正确的?

在web.config中添加此配置

<configuration>
  <appSettings>
    <add key="BaseAddress" value="http://xxx/"/>
  </appSettings>
</configuration>
请务必注意以下事项:
ConfigurationManager.AppSettings["BaseAddress"]