2011-02-19 83 views
2
Protected Overrides Sub Dispose(ByVal disposing As Boolean) 
     Try 
      If disposing = true And components IsNot Nothing Then 
       components.Dispose() 
      End If 
     Finally 
      MyBase.Dispose(disposing) 
     End Try 
    End Sub 

錯誤:受保護的覆蓋子處理(disposing As Boolean)'具有多個具有相同簽名的定義。在覆蓋vb.net中的方法時出現問題

如何在不引發錯誤的情況下調用此函數?

+0

+1爲你的用戶名 – Mehrdad 2011-02-19 02:15:20

+1

你是否在其他地方重寫該方法?這可能會導致這樣的錯誤。你可能在代碼中的其他地方有相同的方法Dispose(ByVal disposing As Boolean)。 – 2011-02-19 02:25:58

回答

1

錯誤表示您有兩個(或更多)具有相同簽名的處置方法。嘗試在同一個類中搜索Dispose方法,如果它是相同的實現,請將其刪除。