上記のエラーを次のコードで取得します。どのようにそれを修正する。ありがとう。 エラー:object.Finalizeをオーバーライドしないでください。代わりに、デストラクタを提供してください
protected override void Finalize() { Dispose(false); }
を下記のコードで探してください。
using Microsoft.Win32;
using System.Runtime.InteropServices;
public class Kiosk : IDisposable
{
#region "IDisposable"
// Implementing IDisposable since it might be possible for
// someone to forget to cause the unhook to occur. I didn't really
// see any problems with this in testing, but since the SDK says
// you should do it, then here's a way to make sure it will happen.
public void Dispose()
{
Dispose(true);
GC.SuppressFinalize(this);
}
protected virtual void Dispose(bool disposing)
{
if (disposing) {
}
// Free other state (managed objects).
if (m_hookHandle != 0) {
UnhookWindowsHookEx(m_hookHandle);
m_hookHandle = 0;
}
if (m_taskManagerValue > -1) {
EnableTaskManager();
}
}
protected override void Finalize()
{
Dispose(false);
}
#endregion
}
+1なぜコードをダンプするのではなく、その理由について少し言及してください。 –
さて、彼は実際になぜ言及していません。例外自体は同じことを述べている。 –