Search

Windows Service template Dispose method does not pass FxCop analysis by Speedbird186

Closed
as Postponed Help for as Postponed

6
Sign in to vote
0
Sign in to vote
Sign in
to vote
Type: Suggestion
ID: 88237
Opened: 9/7/2005 4:27:11 PM
Access Restriction: Public
0
Workaround(s)
When creating a new Windows Service project with VB.NET, the template that is used overrides and overloads the Dispose method from the base class.

However, this implementation does not pass FxCop analysis because if an exception occurs in the code before the call to MyBase.Dispose(disposing), then the base class' resources will not be disposed of correctly.

Also see http://forums.microsoft.com/msdn/ShowPost.aspx?PostID=84736
Details (expand)
Product Language
English
Version
Community Technology Preview August 2005
Category
Language/Compiler/Runtime
Operating System
Windows XP Professional
Operating System Language
US English
Proposed Solution
Use a Try ... Finally block and put the MyBase.Dispose(disposing) call in the Finally block.
Benefits
Improved Reliability
Other Benefits
Improved Reliability
File Attachments
0 attachments
Sign in to post a comment.
Posted by Microsoft on 9/9/2005 at 10:54 AM
Thanks for reporting this issue. I realize this issue has also been reported against C# (see http://lab.msdn.microsoft.com/productfeedback/viewfeedback.aspx?feedbackid=b6a57a3f-f361-4c71-a9f8-770dfc7f5936). Unfortunately, at this stage in the Whidbey product cycle, we're making very few changes and working on stabilizing the code base. So we are postponing this issue and will reconsider it for the next version of the product. You should of course feel free to manually change the code to pass the FxCop warning.

Thanks,
Stephen Weatherford
VB Dev Team