当前,我正在处理一个旧项目,遇到了太多错误,我的目标是在本地计算机上成功进行部署。在下面的此类中,对 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)'