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

  • Home
  • SEARCH
  • 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 5971389
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T20:30:35+00:00 2026-05-22T20:30:35+00:00

I wrote some string extension methods in a VB assembly and am unit testing

  • 0

I wrote some string extension methods in a VB assembly and am unit testing them from a C# project. However, C# acts like it cannot see the the extension methods, when other VB projects reference the VB assembly they have no problem. Both the VB assemebly and the C# test project are targeting .Net 3.5.

Is there a way around this?


VB.Net extension methods:

Imports System.Runtime.CompilerServices
Imports System.Text.RegularExpressions
Imports System.Linq

Namespace ExtensionMethods
    Module StringExtensions

        <Extension()> _
        Public Function Remove( _
                            ByVal input As String, _
                            ByVal subStrings As String()) As String
            ...
        End Function

        <Extension()> _
        Public Function Substrings( _
                            ByVal input As String, _
                            ByVal regexPattern As String, _
                            ByVal regexOptions As RegexOptions) As IEnumerable(Of String)
            ...
        End Function

        <Extension()> _
        Public Function Substrings( _
                            ByVal input As String, _
                            ByVal regexPattern As String) As IEnumerable(Of String)
            ...
        End Function
    End Module
End Namespace

VB.Net usage:

Imports SomeNamespace.ExtensionMethods
...
someString = someString.Remove(subStringsToRemove)

C# usage (doesn’t work):

using SomeNamespace.ExtensionMethods;               //No error, but ExtensionMethods is not in the intellisense
...
someString = someString.Remove(subStringsToRemove);  //error, can't find matching overlaod
  • 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-22T20:30:35+00:00Added an answer on May 22, 2026 at 8:30 pm

    Tried to make the module ‘Public’?

    Update:

    Can’t explain why it worked with other VB assemblies. Think that C# has its own vision of class access modifiers or something.

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

Sidebar

Related Questions

I have some extension methods which could be used like this: MyType myObject; string
We wrote a small Windows class library that implements extension methods for some standard
I wrote some extensions methods to handle the css class like how you would
I needed some simple string encryption, so I wrote the following code (with a
So I wrote some perl that would parse results returned from the Amazon Web
I wrote a windows service using VB that read some legacy data from Visual
I've added some extension methods for strings to make working with some custom enums
I'm trying to brush up on my LINQ by writing some simple extension methods.
I wrote some code with a lot of recursion, that takes quite a bit
I wrote some CSS in my HTML code to create rollover buttons. Then i

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.