Chirag
Chirag

Reputation: 1853

The type or namespace name 'WebUI' does not exist

enter image description hereI have created below WebBasePage class in my Web Application with Visual Studio 2013 (first time in VS2013).

namespace WebApp1.WebUI
{
    public class WebBasePage : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }
    }
}

When I tried to derive above base class in one of my web page (as shown below)...

namespace WebApp1.Errors 
{
    public partial class Error : WebApp1.WebUI.WebBasePage
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }
    }
}

I get the following error at below line:

Line: "public partial class Error : WebApp1.WebUI.WebBasePage"

Error: The type or namespace name 'WebUI' does not exist in the namespace 'WebApp1' (are you missing an assembly reference?)

This code has been working in VS2012, not sure what's wrong with VS2013.

Upvotes: 1

Views: 1304

Answers (1)

DLeh
DLeh

Reputation: 24395

Ensure that the "build action" in the properties pane on the problematic file is set to "Compile". Otherwise Visual Studio will not build the file and won't see the namespace or types defined in that file.

Upvotes: 2

Related Questions