Reputation: 3329
I am trying to create a aspx file inside my project folder. I am trying to create inside a folder called "NIITS" but when i create i get the error,
The namespace 'fig' already contains a definition for 'NIITS'
I see this error in both the cs and designer files. What could be the issue?
code behind:
namespace fig.NIITS.Ora {
public partial class Index : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
}
}
Upvotes: 4
Views: 4627
Reputation: 830
One of the immediate causes that come to mind is possibly having removed the "partial" from either NIITS.designer.cs or NIITS.cs. This would lead the compiler to believe that you do not have two partial class files, but two separate classes of the same name.
Basically, search your files for classes / ... that create a "NIITS" entry in your "fig" namespace. This could happen if, for example, when you have a class fig.NIITS and try to create a class fig.NIITS.Whatever -- the "NIITS" part is already used as class name and it is impossible to resolve if you mean the class NIITS or the namespace "folder" NIITS.
It is odd that you get that error message when you try to create an ASPX template file. I would expect this not to happen on files that contain no items that will be installed in a namespace. But with a code-behind file (or similar class file) this might be a reason.
Upvotes: 3