首页 > 解决方案 > 以下方法或属性之间的调用不明确?

问题描述

目前,我正在做一个旧项目,遇到了太多错误,我的目标是在我的本地机器上成功部署,在下面的这个类中,GetHelpPageSampleGenerator() 带有红色下划线:

 public static class HelpPageConfigurationExtensions
{
    private const string ApiModelPrefix = "MS_HelpPageApiModel_";



    public static void SetSampleObjects(this HttpConfiguration config, IDictionary<Type, object> sampleObjects)
    {
        config.GetHelpPageSampleGenerator().SampleObjects = sampleObjects;
    }

在同一个类中,我有方法 GetHelpPageSampleGenerator() 但重载,这意味着方法 SetSampleObjects 并使用我无法理解的配置参数调用 GetHelpPageSampleGenerator() :

 public static HelpPageSampleGenerator GetHelpPageSampleGenerator(this HttpConfiguration config)
        {
            return (HelpPageSampleGenerator)config.Properties.GetOrAdd(
                typeof(HelpPageSampleGenerator),
                k => new HelpPageSampleGenerator());
        }

我得到的错误:

严重性代码 描述 项目文件行抑制状态错误 CS0121 以下方法或属性之间的调用不明确:“WebInstructionSheet.Areas.HelpPage.HelpPageConfigurationExtensions.GetHelpPageSampleGenerator(System.Web.Http.HttpConfiguration)”和“WebInstructionSheet.Areas.HelpPage.HelpPageConfigurationExtensions” .GetHelpPageSampleGenerator(System.Web.Http.HttpConfiguration)'

标签: c#asp.netasp.net-mvc

解决方案


推荐阅读