|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
FXCop and Asp.net sample programshttp://asp.net/learn/dataaccess/default.aspx?tabid=63 And I got the following error. Basically the code defined a member with type of TableAdapter and no Disposable method is defined. It sounds it's not necessary in the samples. Should I have a empty Dispose method always in this case? protected virtual void Dispose(bool disposing) { if (disposing) { // dispose managed resources, leave it empty } } public void Dispose() { Dispose(true); GC.SuppressFinalize(this); } CriticalError, Certainty 95, for TypesThatOwnDisposableFieldsShouldBeDisposable { Target : EmployeesBLL (IntrospectionTargetType) Resolution : "Implement IDisposable on 'EmployeesBLL' as it instantiates members of the following IDisposable types: NorthwindTableAdapters.EmployeesTableAdapter" Help : http://www.gotdotnet.com/team/fxcop/docs/rules.aspx?version=1.35&url=/Design/TypesThatOwnDisposableFieldsShouldBeDisposable.html (String) Category : Microsoft.Design (String) CheckId : CA1001 (String) RuleFile : Design Rules (String) Info : "Types that declare disposable members should also implement IDisposable. If the type does not own any unmanaged resources, do not implement a finalizer on it." Created : 3/5/2007 9:00:10 PM (DateTime) LastSeen : 3/5/2007 9:00:10 PM (DateTime) Status : Active (MessageStatus) Fix Category : Breaking (FixCategories) } Some of the rules need to be ignored. I think this one can because a
tableadapter doesn't usually wrap unmanaged resources. -- Show quoteRegards, Alvin Bruney ------------------------------------------------------ Shameless author plug Excel Services for .NET is coming... OWC Black book on Amazon and www.lulu.com/owc Professional VSTO 2005 - Wrox/Wiley "Nick nkw" <nick.y.w***@hotmail.com> wrote in message news:D157A592-50B5-4B87-8420-0C3895DDCA7E@microsoft.com... >I tried to use FxCop on the sample of > http://asp.net/learn/dataaccess/default.aspx?tabid=63 > > And I got the following error. Basically the code defined a member with > type of TableAdapter and no Disposable method is defined. It sounds it's > not necessary in the samples. > > Should I have a empty Dispose method always in this case? > protected virtual void Dispose(bool disposing) > { > if (disposing) > { > // dispose managed resources, leave it empty > > } > } > > public void Dispose() > { > Dispose(true); > GC.SuppressFinalize(this); > } > > > CriticalError, Certainty 95, for > TypesThatOwnDisposableFieldsShouldBeDisposable > { > Target : EmployeesBLL (IntrospectionTargetType) > Resolution : "Implement IDisposable on 'EmployeesBLL' as it > instantiates members of the following IDisposable types: > NorthwindTableAdapters.EmployeesTableAdapter" > Help : > http://www.gotdotnet.com/team/fxcop/docs/rules.aspx?version=1.35&url=/Design/TypesThatOwnDisposableFieldsShouldBeDisposable.html > (String) > Category : Microsoft.Design (String) > CheckId : CA1001 (String) > RuleFile : Design Rules (String) > Info : "Types that declare disposable members should also > implement > IDisposable. If the type does not own any unmanaged > resources, do not implement a finalizer on it." > Created : 3/5/2007 9:00:10 PM (DateTime) > LastSeen : 3/5/2007 9:00:10 PM (DateTime) > Status : Active (MessageStatus) > Fix Category : Breaking (FixCategories) > } > > |
|||||||||||||||||||||||