I've downloaded a sample website application from internet that is built using legacy ASP.NET 2.0 WebForms. This application has a custom class named clsTest. In a code behind page Test.aspx.cs this class is declared as:
public clsTest myTest;
But when I compile app I get the following error on the above declaration: The type or namespace name 'clsTest' could not be found (are you missing a using directive or an assembly reference?)
Snapshot of code behind page Test.aspx.cs:
using System;
using System.Web.UI;
using myNameSpace;
namespace myNameSpace
{
public partial class Test : Page
{
public int TotalMethods;
public bool bVal;
public clsTest myTest;
protected void Page_Load(object sender, EventArgs e)
{
....
}
....
....
}
}
Question: Even if I declare using myNameSpace; on top of the code behind page where the clsTest is declared, I'm still getting the above error. Why? Following is a snapshot of the clsTest class:
namespace myNameSpace
{
public class clsTest
{
public bool Errors;
public string FirstName;
public bool FirstNameErr;
public string LastName;
public bool LastNameErr;
}
}
UPDATE
Following is a screen capture of the actual legacy ASP.NET website project that I downloaded from the internet. In this actual app, the class in question is CCProcessor. As you can see in the screenshot below, CCProcessor.cs file is in the root folder of the project and I'm declaring the using ... statement at the top, yet the tooltip in the screenshot is still complaining about missing directive or an assembly. Why? Same error for another class PaymentSettings that is also present in the root folder of the project. NOTE: To see the picture clearly you may want to click on it to see in the entire browser.

clsTestis in a different assembly or project? This probably is the case but I can't find out the assembly the class would be in? Since it's a legacy ASP.NET website project it does not have Reference folder either where I could have searched the assembly. And there is no other project inside the Visual Studio Solution. - nam