2

I've inherited a web project that was being published by another developer. The domain is changing so I've created a new project in VS2005 and added the existing files. I've converted the project to a web application to create the designer files. However, none of the existing pages have a namespace declared. I'm also getting errors referencing classes that exist in a folder within the project (Global.asa sees the classes but no other pages do).

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

2
  • Thanks TLD. I may go with that. I guess the remaining problem is getting the compiler to recognize the files in the App_Code folder. Commented Sep 15, 2009 at 20:44
  • Working - Needed to set the build action to compile in the properties. Commented Sep 15, 2009 at 21:05

1 Answer 1

1

If you're starting from scratch, it may be easier to go completely without namespaces to start. Check the classes in the problem folder and remove namespaces there if they exist. Just to get the site building.

Once you have working code, then you can go back and add in namespaces. Converting old code to WebApps can be a pain, but if you focus exclusively on getting the code to compile before you start refactoring, you'll be in much better shape.

You've probably already seen ScottGUs posting on this topic, but if not, it does show the quickest way to wrap existing code with namespaces.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.