Global.asax没有为预编译的asp.net网站加载

Jim*_*rts 5 asp.net iis-7 precompiled

我使用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>
Run Code Online (Sandbox Code Playgroud)

编译的网站bin文件夹中有一个App_global.asax.dll,但似乎没有帮助.

是否有我缺少的配置选项?删除App_global.asax.dll并使用原始的global.asax与预编译的网站工作正常.

Jim*_*rts 5

我发现的唯一答案是在编译的输出文件夹中包含global.asax(带逻辑).