Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4056082
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T14:46:55+00:00 2026-05-20T14:46:55+00:00

This question is more out of curiosity than a project requirement or a problem.

  • 0

This question is more out of curiosity than a project requirement or a problem.

I have a Non-CLS compliant code in one language (say C#), and I need to use it like that only in my current language (across projects, so making internal is not a choice), and at the same time want to allow other languages (say VB) to be able to call the conflicting implementations without generating compile time error.

For instance,

//C#
public class SecurityService
{
....
    public void Print()
    {
        Console.WriteLine("print"); //This method prints Service Name in lower case
    }

    public void PRINT()
    {
        Console.WriteLine("PRINT");//This method prints service name in UPPER case.
    }
}
'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 the compile time error here by somehow hiding one of my ‘print’ methods from cross language projects (allowing C# projects to call the desired implementation).

Thanks for your interest.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T14:46:56+00:00Added an answer on May 20, 2026 at 2:46 pm

    A language like VB.NET offers no escape around its fundamental syntax rule that identifiers are case insensitive. It is not hard to solve, you can simply write a little static adapter method in a case sensitive language like C# that makes the call.

    public static class Interop {
        public static void Print2(SecurityService obj) {
            obj.PRINT();
        }
    }
    

    You can completely shove it under the doormat by making it an extension method, assuming the language supports it. There will be no actual runtime overhead when the jit optimizer is done with it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This question is more out of curiosity than a real problem. Consider the following
This question is more a re-insurance than one directly about how to code. As
This is a code review question more then anything. I have the following problem:
This is a question more out of curiosity rather than being stuck. I know
This question is more out of curiosity than purpose. Can we change the output
ASP.Net MVC3 is cool and all but I have this question more out of
This question is more about guidance than actually solving my problem: I need to
I suppose this question is more general than working with COM components. I have
This is a bit of a random question that is more out of curiosity
This is more out of curiosity than anything else, as I'm failing to find

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.