This question is more out of curiosity than a project requirement or problem.
I have CLS incompatible code in one language (say C #), and I need to use it the same way as in my current language (for all projects, so making an internal one is not a choice) and at the same time you want to allow other languages ββ(for example, VB) to be able to cause conflicting implementations without generating compile-time errors.
For instance,
public class SecurityService
{
....
public void Print()
{
Console.WriteLine("print");
}
public void PRINT()
{
Console.WriteLine("PRINT");
}
}
'VB.Net
Module ServiceReader
Sub Main()
Dim service As New SecurityService()
service.print() 'Compile time error: print is ambiguos
End Sub
End Module
Problem: I need to avoid a compile-time error, since hiding one of my βprintβ methods from projects with cross languages ββ(allowing C # projects to invoke the desired implementation).
Thank you for your interest.
source