N
Nick nkw
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...hatOwnDisposableFieldsShouldBeDisposable.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)
}
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...hatOwnDisposableFieldsShouldBeDisposable.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)
}