How to solve name conflict between member property and class name

We call from static a member method of Class1 a static method of a Class2

public partial class Class1
  public static Class1Method()

Due to a (generated) update Class1 has now a property called "Class2". We now get the compile error: An object reference is required for the non-static field, method, or property. How to solve this without renaming?

>Solution :

It needs to be fully referenced by namespace. Examples:

MyNamespace.Class1 // = Class1
MyNamespace.Class2 // = Class2
MyNamespace.Class1.Class2 // = the property called Class2 inside Class1

Leave a Reply