including a sub directory

  • Thread starter Thread starter Jon Turner
  • Start date Start date
J

Jon Turner

I have a project (web service) that I have defined some classes in a sub
directory of the project (VS2005), how
do I get my upper level classes, recognize the classes in the sub directory.
In the following directory structure
example, I cannot get a reference to a class defined in Interface1.cs from
ProgramMain.cs. I get the compiler
error "the type or namespace given <class> cannot be found".

Main Directory
- App Code
ProgramMain.cs

- Schemas
file1.xsd
file2.xsd
- Interface
Interface1.cs
Interface2.cs
 
Jon Turner said:
I have a project (web service) that I have defined some classes in a sub
directory of the project (VS2005), how
do I get my upper level classes, recognize the classes in the sub directory.
In the following directory structure
example, I cannot get a reference to a class defined in Interface1.cs from
ProgramMain.cs. I get the compiler
error "the type or namespace given <class> cannot be found".

Main Directory
- App Code
ProgramMain.cs

- Schemas
file1.xsd
file2.xsd
- Interface
Interface1.cs
Interface2.cs

Do you have an appropriate "using" statement? Chances are the interface
in Interface1.cs is declared in a different namespace to the class in
ProgramMain.cs.
 
Jon Skeet said:
Do you have an appropriate "using" statement? Chances are the interface
in Interface1.cs is declared in a different namespace to the class in
ProgramMain.cs.

Apologies - I meant a "using" directive, not a "using" statement. If
I'm going to be a pedant (and let's face it, I am) I should at least
get things right myself :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top