2013年7月24日星期三

re-open close wcf service problems

I new a wcf service, run out to close, and then open when the prompt: "Can not access a disposed object." .
Will not wcf service from close state to the open state transitions do?
------ Solution ---------------------------------------- ----
close itself is an object of the release if you want to open at least have to have a right to object
------ Solution ------------- -------------------------------
Dispose pattern which is standard practice. WCF service object is to achieve the Dispose pattern, while Microsoft's class, if there are both Dispose Close, then complete the function of both is the same. That is, after calling Close, just call the Dispose same object will be marked as IsDisposed == true. This can no longer be used.
so close to re-open after the service, you can only re-new an object.

没有评论:

发表评论