I have a VB.NET class library project which assembly name is MyCompany.Constants and it only contains a module MyModule.vb :
Public Module Constants
Public Const Item1 As String = "Foo"
Public Const Item2 As String = "Foo2"
End Module
The purpose of it is to share it across all the projects in other solutions.
So I add a reference to it from other projects and then I use the below expression to start working with it:
Imports MyCompany.Constants
So then I can use it by performing:
var foo = Constants.Item1
But above import expression throws an error saying:
namespace or type specified in the imports 'MyCompany.Constants' doesn't contain any public member
So How can I face this problem? How can I use public constants defined in the module in my other projects by adding a reference to it?
Try this :