Global.asax没有为预编译的asp.net网站加载 [英] Global.asax not loading for precompiled asp.net website

查看:242
本文介绍了Global.asax没有为预编译的asp.net网站加载的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Visual Studio 2008发布我的asp.net网站。当我在服务器上启动网站(Windows 2008服务器)时,我注意到global.asax中的代码没有运行。我的Global.asax正文类似于:

I used Visual Studio 2008 to publish my asp.net website. When I bring up the website on the server (Windows 2008 server), I noticed that the code in global.asax was not running. My Global.asax body is similar to:

<%@ 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,但似乎没有帮助。

There is a App_global.asax.dll in the compiled websites bin folder, but that does not seem to help.

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

Is there a configuration option that I'm missing? Removing the App_global.asax.dll and using the original global.asax with the precompiled website works fine.

推荐答案

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

The only answer I've found is to include global.asax (with logic) in the compiled output folder.

这篇关于Global.asax没有为预编译的asp.net网站加载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆