asp.net 的 global.asax 文件发布之后上传到空间上执行不到。。
以前上传到VPS上都能执行到。现在换了一个空间就执行不到了。IIS能执行到。在本地测试了的。
急..急...急...在线等 

解决方案 »

  1.   

    Global文件要放到根目录才好使
      

  2.   

    一些属性方法在里面用context调用,这样试试呢 
      

  3.   

    是不是web.config没配置好?
    找空间支持商啊
      

  4.   

    可以重启一下试试 :
    重启应用程序池可用命令 net   stop   iisadmin   /y 
    然后net   start   w3svc 
    或者试试
    运行-> cmd-> 输入命令:iisreset   
      

  5.   

    现在就是很茫然啊。空间服务商认为是程序的问题。
    但是以前在VPS上都好好的。郁闷得很。
      

  6.   

    你现在使用的是codebehind么?如果是你尝试把你的global里面的逻辑按照in-line的方式提供,就是用
    <script runat=server>
    //your logic code here
    </script>
      

  7.   

    重新发布也试了。在global.asax里面有个时间的事件。到了那个时间就是不执行。
      

  8.   

    <%@ Application Language="C#" %><script RunAt="server">    System.Timers.Timer Timer1 = new System.Timers.Timer();
        void Application_Start(object sender, EventArgs e)
        {
            Timer1.Elapsed += new System.Timers.ElapsedEventHandler(Timer1_Elapsed); /
            Timer1.Interval = 1800;
            Timer1.Enabled = true;    }
        /// <summary>
        /// 执行的事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Timer1_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
        {
            lock (Timer1)
            {
                setTestDelegate testdel = new setTestDelegate(Entrust.PlanStock);
                IAsyncResult iaResult = testdel.BeginInvoke(null, null);
                if (iaResult.IsCompleted)
                {
                    testdel.EndInvoke(iaResult);
                }
            }
        }
        private delegate void setTestDelegate();    void Application_End(object sender, EventArgs e)
        {
            //  在应用程序关闭时运行的代码    }    void Application_Error(object sender, EventArgs e)
        {
            // 在出现未处理的错误时运行的代码    }    void Session_Start(object sender, EventArgs e)
        {
            // 在新会话启动时运行的代码    }    void Session_End(object sender, EventArgs e)
        {
            // 在会话结束时运行的代码。 
            // 注意: 只有在 Web.config 文件中的 sessionstate 模式设置为
            // InProc 时,才会引发 Session_End 事件。如果会话模式设置为 StateServer 
            // 或 SQLServer,则不会引发该事件。    }
           
    </script>这是我在global.asax里面写的代码``