我使用Visual Studio 2008发布我的asp网站。当我在服务器上启动网站(Windows 2008服务器)时,我注意到global.asax中的代码没有运行。我的Global.asax正文类似于:
I used Visual Studio 2008 to publish my asp 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网站加载
发布评论