c# - 以下方法或属性之间的调用不明确?
问题描述
目前,我正在做一个旧项目,遇到了太多错误,我的目标是在我的本地机器上成功部署,在下面的这个类中,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)'
解决方案
推荐阅读
- python - 如何仅将引号添加到感兴趣的子字符串?
- opencv - Haartraining 错误“参数之一的值超出范围(cvAlloc 函数的负值或太大的参数)”
- javascript - UserModel 不可分配给 Document | 类型的参数 nulll [带有 Typescript 的猫鼬]
- xamarin.forms - 进度条未出现在指定位置
- python - 如何加快距离矩阵计算?
- java - java.lang.IllegalStateException:未注册检测!必须在注册仪器下运行
- java - 从数据库中获取 NULL 值
- android - 无法解析 Android Studio 中的依赖项
- sql - 如何编写一个函数来获取oracle中一行的当前生效日期
- python - 具有不确定数量的进程的多处理