我尝试学习一些Azure网络应用程序的东西但是......
我将一个应用程序设置添加到部署槽并尝试通过ConfigurationManager.AppSettings [“TEST”]读取它,但它是空的。
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 :(得分:0)
Configuration Manager仅允许您访问本地配置文件,以便访问使用CloudConfigurationManager
类或RoleEnvironment
类所需的Azure配置设置。
可以找到更多详细信息http://swiftmailer.org/downloads/archive。