Apparently Close and Dispose are effectively the same. I want to be able to Close and Open my ServiceHost instance without having to reinstantiate it everytime. Any ideas? Thanks.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
ServiceHost.Close is effectively identical to
Dispose(). This is true, in general, with all types that have aClose()method –Dispose()is implemented in terms ofClose().FYI –
ServiceHostBaseimplementsDispose()explicitly via:This, effectively, means that when you close the ServiceHost, you’ll always Dispose() of it. There is no supported way to “reopen” it without recreating it.