If I have a static WebClient object, do I need to call Dispose() on it at the end of Main()?
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.
You should always
Dispose()objects when you’re finished with them, regardless of where you put the object.If the object is in a static field, it may be more difficult to figure out when you’re finished with it.