Events in Global.asax are not firing

前端 未结 5 1931
有刺的猬
有刺的猬 2021-01-19 03:27

In my ASP.Net application, I can\'t get the events in Global.asax to fire on my machine. For instance, Session_Start will not fire.

The same Global.asax works fine

相关标签:
5条回答
  • 2021-01-19 03:37

    As I write here, in my case, I was publish my site in production and I miss copy to server App_global.asax.compiled file. For this reason was not fire the Events inside Global.asax.

    Hope anyelse help this tips, I lost 8 hours seeking.

    0 讨论(0)
  • 2021-01-19 03:38

    Application level events only need proper naming to work. Is your codebehind class being designated in your Global.asax file?

    <%@ Application Inherits="YourNamespace.YourApplicationClass" Language="C#" %>
    
    0 讨论(0)
  • 2021-01-19 03:51

    This is a long shot but I have been bitten by this before. When you created your Global.asax.cs file did you make sure to include a basic Global.asax file in your project?

    Also make sure that the inherits property in that Global.asax is pointing to your custom class (namespace and all) in your Global.asax.cs file.

    I had this problem once and it was because I totally forgot to make the Global.asax file and hook it up to my class. I had just copied the Global.asax.cs from another project that did something similar.

    0 讨论(0)
  • 2021-01-19 03:54

    becuase project is compiled first and then you have add or modify or changed location of global.asax.vb.

    Solution :- Just remove debug folder. Clean project and then rebuild whole project.

    Regards, Mihir

    0 讨论(0)
  • 2021-01-19 03:56

    If you have fiddled with ASP.NET then maybe try reinstalling it.

    0 讨论(0)
提交回复
热议问题