如何解决“没有合适的方法来覆盖”错误? [英] How to resolve "no suitable method to override" error?

查看:71
本文介绍了如何解决“没有合适的方法来覆盖”错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个功能:

protected override void DeserializeSection(XmlReader reader)



现在在论证中如果我正在放置



protected override void DeserializeSection(RegistrationInfoSetting _regInfo)。

但是在构建中它给出了一个错误没有合适的方法来覆盖。



可能是什么原因以及如何解决?



注意: XmlReader是一个摘要class



而RegistrationInfoSettingDB就像这样

公共类RegistrationInfoSettingsDB:BaseDB,IRegistrationInfoSettingDB

推荐答案

您收到错误,因为没有方法 DeserializeSection 带有 RegistrationInfoSetting 作为基类中的参数;只有一个 XmlReader 作为参数。因此,您不能(也不需要)覆盖它,因为它不在基类中。您可以通过删除覆盖字来解决此问题。
You get the error because there is no method DeserializeSection with a RegistrationInfoSetting as parameter in the base class; there is only one with a XmlReader as parameter. So, you cannot (and don't need to) override it, because it is not in the base class. You can resolve this by removing the override word.


这篇关于如何解决“没有合适的方法来覆盖”错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆