0

Say I have a snippet like this from an external dll that I have to use.

public class DerivedClass : IBaseInterface
{
    [JsonIgnore]
    [NonOverridable]
    [InspectorReadOnly]
    public string name;

    string IBaseInferface.name {
        get {
            return name;
        }
        set {
            name = value;
        }
    }
}

And I am publicising the dll using https://github.com/AzeTheGreat/Publicise so that I can access the private members as public.

But if I use the publicised dll in JetBrains Rider like this:

public class Main
{
    private DerivedClass dobj;
    
    public void func()
    {
        // Jetbrains intellisense shows an ambiguous referencee error
        //   <AccessTest>\Main.cs:339 Ambiguous reference:
        //   string IBaseInterface.name (in class DerivedClass)
        //   string name (in class DerivedClass)
        //   match
        dobj.name = "";
    }
}

However, the project builds fine without any errors. And doing the same thing Visual Studio, VS intellisense does not detect any errors at all.

One possible explanation is that, the JetBrains decompiler seems to show the publicised IBaseInterface.name as public but Visual Studio decompiler does not. (This does not make any sense to me, since they are the same assembly and the decompilers are showing different things.)

Is there a way to solve this (I can't change the external DLL) ? Or at least mark the line so that intellisense doesn't complain in JetBrains Rider?

Vikash Balasubramanian
  • 2,921
  • 3
  • 33
  • 74

0 Answers0