Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is this Public Function in a Module not accessible

I have an assembly comprised of several useful little utilities. Within that I have a module Containing a simple Public Function.

Module FishTrackerConfigurations

Public Function GetValueOfUseProductId As Boolean
    Return VtlGetUseProductId 'A simple private routine in the same module
End Function
End Module

When I call this function from another project (in which this assembly is referenced I get the following error.

Error   BC30390 'FishTrackerConfigurations.Public Function GetValueOfUseProductId() As Boolean' is not accessible in this context because it is 'Public'.   

The function is being called from within my projects Application.Xaml.VB file, specifically in the Protected Overrides Sub OnStartup(e As StartupEventArgs) routine.

I'd like to know why this happens.

like image 588
Dom Sinclair Avatar asked Apr 19 '16 08:04

Dom Sinclair


1 Answers

Although the method is Public, the Module (by default) is not.

You need to specify this explicitly:

Public Module FishTrackerConfigurations
like image 197
Matt Wilko Avatar answered Nov 20 '22 02:11

Matt Wilko