我遇到了FxCop的問題,並且警告:Abstract types should not have constructors
。FxCop當沒有新的時候,抽象類型不應該有構造函數
這是顯示爲許多抽象類(可能所有,我沒有檢查)。當我看他們大多沒有新的方法,所以我認爲它是編譯器添加一個默認的方法。因此,要刪除它,我加一個私人默認constuctor(Private Sub New()
),這則意味着所有的inherting類未能建立與錯誤: Class 'InheritingClass' has no accessible 'Sub New' and cannot be inherited.
這似乎很奇怪,因爲FxCop的請求,沒有公共的構造,但是當我刪除了構建失敗。
現貨,並且說明是有幫助了。 – themaninthesuitcase 2010-11-26 11:42:39