Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Class constructor called every method call
Message
 
 
À
30/07/2014 06:11:47
Information générale
Forum:
ASP.NET
Catégorie:
Windows Communication Foundation (WCF)
Versions des environnements
Environment:
C# 2.0
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01604869
Message ID:
01604958
Vues:
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 :-}

What an excellent post.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform