Why are the Global.asax events not firing in my ASP .NET website?

前端 未结 11 1931
执笔经年
执笔经年 2020-12-11 15:24

I\'ve been developing an ASP .NET 3.5 web application against Cassini, the built-in web development server, rather than against IIS.

In my Global.asax file, in the A

相关标签:
11条回答
  • 2020-12-11 16:01

    How are you logging? Is it possible that your logging component is not correctly set up? For a quick test try throwing an exception inside Application_Start and that will tell you quickly whether or not the event is being raised.

    0 讨论(0)
  • 2020-12-11 16:01

    We tried a lot of things.

    1. global.asax works on local computer but not after i publish to server
    2. Global.asax is not publishing and event are not firing in Global.asax
    3. Global.asax not firing for Release build
    4. Mystery of Global.asax in ASP.NET MVC application

    We also tried putting the below files in root and bin directories.

    1. App_global.asax.dll and App_global.asax.compiled files
    2. PrecompiledApp.config

    None of it worked!

    We had to put raw Global.asax instead of pre-compiled dll, in order to fire the global events, for our asp .net 2.0 website.

    Hope this helps someone! Cheers! Happy coding! :D

    0 讨论(0)
  • 2020-12-11 16:02

    When you develop in Cassini you are running the application under the user's account- probably administrator. Once you've deployed to IIS, you are (hopefully) running under a lower privilidge account.

    This lack of appropriate permissions is probably the reason why your application is not working correctly- I would check the security settings to write to the log (presumably you are writing to a log file?).

    0 讨论(0)
  • 2020-12-11 16:07

    If you make a request to your app does the "Application_Start" fire then? I don't believe it will be started until the first request is made.

    0 讨论(0)
  • 2020-12-11 16:09

    1) iisreset /stop
    2) push the published code to iis virtual directory's physical folder.
    3) iisreset /start
    4) make web request

    Still not sure after this. the do a Thread.Sleep(60000); and attach with remote debugger to the process w3wp.exe imagename.
    There may be more than one process of that name but this one is managed code also doesn't hurt to attach to multiple. Set the break point after the sleep. After the one minute sleep step through.

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