views:

160

answers:

5

So I wrote some custom classes and put them all in a namespace, call it "Sphere".

On my aspx.cs codebehind file, I have "using Sphere;" written. I know that this works because it's always worked until I copied this project to a new folder. Also, even when I click "view in web browser" everything works perfectly.

Simply, Visual Studio 08 is not recognizing the namespace and so I cannot build without an error and consequently cannot debug. Thanks for the help!

edit: I have my namespace in my App_Code folder in a .cs file

+3  A: 

Are your custom classes in a separate project? If so, you might need to add a reference to that project. If you have copied the project to a new folder, the path to your Sphere DLL/project in VS2008 might be broken.

tomlog
I just have the namespace in a .cs file in my app_code folder
A: 

Check your references. It's possible VS is no longer finding them after you moved your application's folder.

Badaro
A: 

Sounds like missing reference.

In your new project, do you have a reference to the project that defines the actual Sphere namespace?

Alan
A: 

It sounds like when you moved the files the references were broken. If the sphere classes are in a seperate dll try deleting and re-adding the reference. If it is just in a .de file be sure that filein the project is still in the relative path.

Greg
+1  A: 

I actually just figured it out:

My .cs files were set to "build action: content" rather than "compile." I right-clicked + properties all my files and changed the build action, and now it all works!

Please change the question title because this really had nothing to do with namespaces.
dss539