Last post Apr 05, 2011 11:33 AM by Gonki
Aug 21, 2009 10:31 AM|javiguillen|LINK
I have this WCF service where I want to execute some initialization code on the service class, when the ASP.NET application triggers a session_start event. Problem is, WCF services use copies of contracts - not the type itself; so the class consturctor as
WCF service does not execute the constructor. One option would be to configure the service call to use types but that is not a good practice from what I understand. The other option is to add client constructor on the WCF client class, but that sounds too
complicated from what Im trying to do and perhaps not even effective as the code I need to execute is server side.
Anyhow, I tried to fix this by creating a separate method outside of the constructor. Problem I'm having is that the session_onstart is being executed twice when I run the ASP.NET app in debug mode. It gets triggered the second time when the additional
method on the WCF clas is called... why is that? does the call of a WCF method on the session_start triggers a new ASP.NET session?
In any case, do you know of any work around?
Thanks for any help
Apr 05, 2011 11:33 AM|Gonki|LINK