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

编程入门 行业动态 更新时间:2024-10-27 18:19:22
本文介绍了Global.asax没有为预编译的asp网站加载的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我使用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网站加载

本文发布于:2023-11-04 10:06:14,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1557635.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:加载   网站   asax   Global   net

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!