Application_start not working

后端 未结 5 553
青春惊慌失措
青春惊慌失措 2021-01-14 00:32

I have written some code in the application_start() method in my global.asax file. It does not get called when I deploy my application on IIS

5条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-14 00:59

    Make sure that the Global.asax file is actually deployed to the destination folder in the root. If the file is not present then the code behind you have written for Application_Start will never be called.

    Also make sure the signature is correct

    public class Global : System.Web.HttpApplication {
       protected void Application_Start(object sender, EventArgs e) {/*do something here like logging so you know it was called*/}
    }
    

提交回复
热议问题