Yesterday, I was getting below error continously when I was working on a sample of MasterPage.
CS0426: The type name 'MyMaster' does not exist in the type 'System.Web.UI.WebControls.TreeView'
While I tried a lot many things (deleting page, adding new etc.) and also googled couple of things, but could not get any clue. Later while reading a post I realized the problem.
Problem here was that I had named my project (and thereby assembly and the namespace) as TreeView. So at runtime, the CLR was trying to find my master page inside Sytem's standard treeview class.
So solution was simple i.e. just change the project and namespace name to a non reserved work like TreeviewPOC in my case.
So next time you get CS0426 error, just check if your namespace or project name is colliding with any of the standard (or even third party controls etc).
Happy Coding
Regards,
Subhash Dike
I also named my asp.net project to DropDownlist and got the same error. The error disappeared after renaming it to DropDownListProject.
ReplyDeleteThanks a Lot
Changing Namespace name worked for me! Thanks
ReplyDeleteyeah its really worked for me and i learned one thing that we should not keep the name of project with any controls name
ReplyDeleteThanks alot it worked for me as well:)
ReplyDeleteI know this is an older thread, but I had the same issue, and hadn't seen a fix yet. It turned out that I had named my project (a throwaway learning project) the same name as a .NET assembly (WebMail), and so I changed the project name and any references to WebMail, and that fixed it.
ReplyDeleteThanx a lot work this solution.......
ReplyDelete