The call is ambiguous between single method i.e extension method

前端 未结 6 929
悲&欢浪女
悲&欢浪女 2021-02-12 04:06

I have an extension method like

public static class Extension
{
    public static string GetTLD(this string str)
    {
        var host = new System.Uri(str).Hos         


        
6条回答
  •  滥情空心
    2021-02-12 04:31

    I had the same problem but for me it solved the problem to remove the own project from the project references. Resharper accidentally added a reference to the compiled binary of the same project. That way I had the same extension class 2 times within my project. During building it couldn't distinguish between the source-version or the binary-version of the extension class.

    So basically: Check your project references if it contains a reference to itself.

    Answer provided by @shashwat is also a case.

提交回复
热议问题