Adding namespace to existing ASP.NET 2.0 C # project

I inherited a web project that was posted by another developer. The domain is changing, so I created a new project in VS2005 and added the existing files. I converted the project to a web app to create designer files. However, none of the existing pages declares a namespace. I also get errors referencing classes that exist in a folder inside the project (Global.asa sees classes, but not other pages).

Is there a recommended way to add a namespace to all files and / or get files to recognize classes in the root folder?

+2


source to share


1 answer


If you are starting from scratch, it may be easier to go completely without running names. Check the classes in the problems folder and remove the namespaces there if they exist. Just to get the site.

Once you have working code, you can go back and add namespaces. Converting legacy code to WebApps can be painful, but if you focus solely on getting the code to compile before refactoring, you'll be in much better shape.



You've probably already seen ScottGUs post on this topic , but if not, this shows the fastest way to port existing code using Namespaces.

+1


source







All Articles