C#错误:类型'x'已经定义了一个名为'y'的成员,它具有相同的参数类型

Art*_*ani 3 c#

Visual C#Express上,我使用下面的代码得到以下错误:

'type'myComponent.SettingsComponent'已经使用相同的参数类型定义了一个名为'SolveInstance'的成员'

但我只在SolveInstance那里使用过.我做错了什么,下次我怎么能自己解决这个问题?

namespace myComponent
{
    public class SettingsComponent : GH_Component
    {
        protected override void SolveInstance(IGH_DataAccess DA)
        {
        }

        protected override void  RegisterOutputParams(GH_Component.GH_OutputParamManager pManager)
        {
        }

        protected override void SolveInstance(IGH_DataAccess DA)
        {
            if (m_settings == null)
            {
                AddRuntimeMessage(warning, "You must declare some valid settings");
                return;
            }
            DA.SetData(0, m_settings);
        }
    }
}
Run Code Online (Sandbox Code Playgroud)

Jef*_*tis 5

看起来你有两个实例

protected override void SolveInstance(IGH_DataAccess DA)
Run Code Online (Sandbox Code Playgroud)

在您的示例类中,一个具有空主体,另一个具有代码.