Search code examples
.netvb.netdllstructurehierarchy

Building an API structure, members of a module are scoped to wrong namespace


I'm using Visual Studio 2013, trying to develop an own API that has this members structure:

enter image description here

The problem is that the members of the Extensions module are exposed in Elektro.Xml.Extensions but also in Elektro.Xml :

enter image description here enter image description here

Why happens this? and how to fix it?.


Extensions.vb

Public Module Extensions

#Region " Public Extension Methods "

#Region " Type Conversion "

    <Extension>
    Public Function ToXDocument(ByVal sender As XmlDocument) As XDocument
       ...
    End Function

#End Region

#End Region

End Module

XmlUtil.vb

Public NotInheritable Class XmlUtil

#Region " Public Methods "

    Public Shared Function XmlBeautifier(...) As String
        ...
    End Function

#End Region

End Class

Solution

  • Examining a random 3rd party API in github (something that I normally do to discover new techniques and acquire knowledge) I found that to solve this issue the developer just could set the HideModuleName attribute to the module and voilá.