0

I'm trying to add a class to a new namespace in my project. I have the following:

Namespace Admin
    Public Class Page
        ' Some Code
    End Class
End Namespace

I'm then trying to access that on my code behind file using:

Dim page As New Admin.Page()

For some reason, it isn't recognising Admin as a namespace, is there something obvious I'm missing here? I've attempted to add a reference to my namespace, but it does not appear in the list when I right click references and add reference in the solution explorer

Ant
  • 462
  • 1
  • 4
  • 18

2 Answers2

1

I'm not sure how many people will need this, but it turns out the issue is to do with the "Build Action" setting on the class file in VS2012. I needed to change it to Compile, as opposed to "Content".

I'm unsure what this does, I just know that this allowed me to access the namespace.

Ant
  • 462
  • 1
  • 4
  • 18
  • http://stackoverflow.com/questions/145752/what-are-the-various-build-action-settings-in-vs-net-project-properties-and-wh and http://stackoverflow.com/questions/22552589/what-is-content-build-action-in-visual-studio for some more information. – Styxxy Jan 20 '15 at 00:14
0

The Answer is Simple, if you have specified the Root Namespace from the Project Properties > Applications, then you will need to call your namespace as

Dim page As New <Rootnamespace>.Admin.Page()
Dennis Henry
  • 76
  • 10