This question is locked. New answers and comments are not allowed.
I have ran into false errors with extension method defined inside partial class.
I have attached test code to reproduce the issue. The problem is that second partial class is missing keyword "static". But the code get compiled just fine.
Edit:
The same also happend when one of those classes is missing "public" access modifier and the extension method is used in different assembly.
Zbynek
I have attached test code to reproduce the issue. The problem is that second partial class is missing keyword "static". But the code get compiled just fine.
Edit:
The same also happend when one of those classes is missing "public" access modifier and the extension method is used in different assembly.
Zbynek
| namespace TestProject |
| { |
| public static partial class Extensions |
| { |
| //... |
| } |
| partial class Extensions |
| { |
| public static void ExtentionMethod(this object obj) |
| { |
| } |
| } |
| class Program |
| { |
| static void Main(string[] args) |
| { |
| object obj = new object(); |
| obj.ExtentionMethod(); |
| } |
| } |
| } |