Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Class constructor called every method call
Message
General information
Forum:
ASP.NET
Category:
Windows Communication Foundation (WCF)
Environment versions
Environment:
C# 2.0
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01604869
Message ID:
01604953
Views:
39
>The service is instantiated in my form ( once in the c'tor ) it's the biz class which gets instantiated by my service - the session is terminated in the form closing event.

So I take it that you are creating a ServiceHost instance in Winforms? Then, if using sessions, it will create a new service instance each time a client opens a channel. Does that explain what you are seeing ? If you don't want that to happen then you need InstanceContextMode.Single.

If you do want PerSession behaviour it might be a good idea to also set the SessionMode to 'Required'. In that case if the binding doesn't support sessions then the service will throw an exception. See 'Sessions Interact with InstanceContext settings' here: http://msdn.microsoft.com/en-us/library/ms731193.aspx for the behaviours of different combinations.

HTH finally :-}
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform