2017-03-22 79 views
0

我尝试学习一点点Azure的web应用程序的东西,但...Azure的web应用程序ConfigurationManager.AppSettings为空

我添加应用程序设置部署插槽和尝试通过ConfigurationManager.AppSettings读它[”测试“],但它是空的。

Azure portal

using System; 
using System.Collections.Generic; 
using System.Linq; 
using System.Web; 
using System.Web.UI; 
using System.Web.UI.WebControls; 
using System.Configuration; 

namespace WebApplication1 
{ 
    public partial class WebForm1 : System.Web.UI.Page 
    { 

     protected void Page_Load(object sender, EventArgs e) 
     { 
      string text = ConfigurationManager.AppSettings["TEST"]; 
      Button1.Text = text; 
     } 
    } 
} 

回答

0

配置管理器只,您可以访问你的本地配置文件,以访问,你需要为使用的CloudConfigurationManager类或RoleEnvironment类Azure的配置设置。

更多详细信息可查询here

相关问题