WCF Global.asax events do not fire

I created a WCF application with the Global.asax file. I added AspNetCompatibilityRequirements (RequirementsMode = AspNetCompatibilityRequirementsMode.Required) on top of the service class and added to web.config. The Global.asax Application_Start event is fired when the application is debugged, but when it is deployed to IIS7, it does not fire.

Any help or idea?

Thank.

+3
source share
1 answer

If you make a request to your application, then "Application_Start" is launched? I do not think it will be launched before the first request.

Application level events only require the correct naming convention to work. Is your codebehind class specified in your Global.asax file?

 <%@ Application Inherits="YourNamespace.YourApplicationClass" Language="C#" %>

(or)

Project

becuase , global.asax.cs.

: - . , .

Edit

aspx codebehind , , .

, :

HttpContext.Current.Response. → -

ASAX -

0

All Articles