如何解决CS0121不明确的方法或属性?

时间:2017-01-12 21:53:06

标签: c# asp.net-core asp.net-core-mvc ambiguous

我有一个MVC Core Web应用程序。在尝试添加一些会话数据失败后,在其中要求我包含缺少的引用,我突然得到几个不明确的引用错误,显然无法跟踪查明违规引用。我试图解决方案清理和重建,并恢复参考,但这没有帮助。

我没有找到在磁盘上查找引用的方法(右键单击解决方案资源管理器中的引用不提供删除或打开文件资源管理器中的位置的选项。

我没有ReSharper工具。

我不知道如何修复此错误。 以下是我的参考资料:

enter image description here

具体错误(其中3个)是:

    Severity    Code    Description Project File    Line    Source
Error   CS0121  The call is ambiguous between the following methods or properties: 'System.Security.Claims.PrincipalExtensions.FindFirstValue(System.Security.Claims.ClaimsPrincipal, string)' and 'System.Security.Claims.PrincipalExtensions.FindFirstValue(System.Security.Claims.ClaimsPrincipal, string)'  OmniPot..NETCoreApp,Version=v1.0    C:\zzWork\Omnipot\Main\Source\OmniPot\src\OmniPot\Controllers\AccountController.cs  194 IntelliSense

    Severity    Code    Description Project File    Line    Source
Error   CS0121  The call is ambiguous between the following methods or properties: 'Microsoft.Extensions.DependencyInjection.IdentityServiceCollectionExtensions.AddIdentity<TUser, TRole>(Microsoft.Extensions.DependencyInjection.IServiceCollection)' and 'Microsoft.Extensions.DependencyInjection.IdentityServiceCollectionExtensions.AddIdentity<TUser, TRole>(Microsoft.Extensions.DependencyInjection.IServiceCollection)'  OmniPot..NETCoreApp,Version=v1.0    C:\zzWork\Omnipot\Main\Source\OmniPot\src\OmniPot\Startup.cs    82  IntelliSense

    Severity    Code    Description Project File    Line    Source
Error   CS0121  The call is ambiguous between the following methods or properties: 'Microsoft.Extensions.DependencyInjection.OptionsServiceCollectionExtensions.Configure<TOptions>(Microsoft.Extensions.DependencyInjection.IServiceCollection, System.Action<TOptions>)' and 'Microsoft.Extensions.DependencyInjection.OptionsServiceCollectionExtensions.Configure<TOptions>(Microsoft.Extensions.DependencyInjection.IServiceCollection, System.Action<TOptions>)'  OmniPot..NETCoreApp,Version=v1.0    C:\zzWork\Omnipot\Main\Source\OmniPot\src\OmniPot\Startup.cs    105 IntelliSense

0 个答案:

没有答案