Flawed as I am, I've received some unneeded help in creating errors in the form of Visual Studio 2008 adding incorrect code to a .designer.cs file. I appreciate, it is probably doing this because of my omission or error - but I will use the excuse that I am in actuality a fledgeling ASP.NET developer so I'm still learning.
The relevant parts of the solution exporer look like this:
/Prototypes
/Project01.Master
- Project01.Master.cs
- Project01.Master.designer.cs
/SampleApplication.aspx
- SampleApplication.aspx.cs
- SampleApplication.aspx.designer.cs
I'm not entirely sure which files to include in the question, so I'll try and guess as best I can. Both the .Master.cs and SampleApplication.aspx.cs include themselves within the Project01.Prototypes namespace (though I'm not precious about that, it's something that was auto-added and worked while I didn't need to think about it).
At the top of SampleApplication.aspx is the following (to enable access to some properties that the Master Page in theory, exposes.
<%@ Page Language="C#" MasterPageFile="~/Prototypes/Project01.Master" AutoEventWireup="true" CodeBehind="SampleApplication.aspx.cs" Inherits="Project01.Prototypes.SampleApplication" %>
<%@ MasterType VirtualPath="~/Prototypes/Project01.Master" %>
Within the SampleApplication.aspx.designer.cs is:
namespace Project01.Prototypes {
public partial class SampleApplication {
public new Project01.Prototypes.Project01 Master {
get {
return ((Project01.Prototypes.Project01)(base.Master));
}
}
}
}
All this results in the error:
The type name 'Prototypes' does not exist in the type 'Project01.Prototypes.Project01'
I can fix this error and get the build going again by getting rid of the 'Project01.Prototypes.' references within the class itself (leaving the namespace). My problem is that this is only a temporary solution as Visual Studio keeps adding it back in - so I guess the question is where is my mistake actually located?
p.s. If it's important, I'm running in Visual Studio 2008 with a ASP.NET MVC Web Application.