我使用 Visual Studio 2008 发布我的 asp.net 网站。当我在服务器(Windows 2008 服务器)上打开该网站时,我注意到 global.asax 中的代码没有运行。我的 Global.asax 主体类似于:
<%@ Application Language="C#" %>
<script runat="server">
protected void Application_Start()
{
// Initialize some site settings like a task scheduler
}
protected void Application_End(object sender, EventArgs e)
{
// Perform some clean up code
}
</script>
编译后的网站bin文件夹中有一个App_global.asax.dll,但这似乎没有帮助。
是否有我缺少的配置选项?删除 App_global.asax.dll 并将原始的 global.asax 与预编译的网站一起使用效果很好。
我找到的唯一答案是在编译的输出文件夹中包含 global.asax (带有逻辑)。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)