.NET Framework Developer Center >
.NET Development Forums
>
Windows Communication Foundation
>
WCF3.5
WCF3.5
- In case of remoting i can configure singleton, singlecall in config file
In case of WCf we are using attribute
[ServiceBehavior(ConcurrencyMode = ConcurrencyMode.Single, InstanceContextMode = InstanceContextMode.PerCall)]
So if there needs a change i have to open the code and change it, is there a way to do it in config.
I am new to WCF
Answers
- Hi,
You can manage no of sessions, instances and calls using App.Config file, but cannot change service behaviors values. There may be reason that these service behaviors drives the communication between client application ans WCF service that's why not given in app.config.
But I will try to check it.
Mahesh Sabnis- Marked As Answer byBin-ze ZhaoMSFT, ModeratorMonday, November 09, 2009 7:51 AM
All Replies
- There is no way to change it in code. I would wonder if there is one.
Btw, ConcurrencyMode.Single and InstanceContextMode.PerCall makes not much sense because you get a new service object with each client call and then this object dies, so there are no other clients who would make some threading problems. - Hi Huber
Thanks for your reply..
But my question is suppose
I have configured as Singleton in WCF([ServiceBehavior(ConcurrencyMode = ConcurrencyMode.Single, InstanceContextMode =
InstanceContextMode.Single)]) and deployed in clinet. Due some reason i want to change the behavior to SingleCall.
In case of Remoting i will do in app.config so no need to rebuild the code. I want to do the same in WCF (Move the attribute to Configuration file)
Please through some light on it..... - Hi,
You can manage no of sessions, instances and calls using App.Config file, but cannot change service behaviors values. There may be reason that these service behaviors drives the communication between client application ans WCF service that's why not given in app.config.
But I will try to check it.
Mahesh Sabnis- Marked As Answer byBin-ze ZhaoMSFT, ModeratorMonday, November 09, 2009 7:51 AM


