【发布时间】:2010-09-13 14:24:26
【问题描述】:
在我的 global.asax 中,我有以下代码:
public static bool Was = false;
protected void Application_Start(object sender, EventArgs e)
{
Was = true;
}
当我打开一个页面并查看Was 变量时,它仍然是false。是什么赋予了? (注意:这个变量没有在其他地方使用,我只是为了这个测试用例)
更新: 我刚刚发现我的整个 global.asax 文件被忽略了。这怎么可能?
更新 2: 抱歉,它确实会起作用。但那里有额外的奇怪之处。如此多的奇怪之处,我为此打开了a new question。
【问题讨论】: