Reference to a namespace

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

Jon

I have an example C# programme which shows me how to communicate with a scientist instrument. It
includes the namespace statement "using Ivi.Visa.Interop"

If I copy this into a blank winform programme, when I compile, I get an error "The type or namespace
name 'Ivi' could not be found (are you missing a using directive or an assembly reference?)"

How do I do this? I can presumably find the required reference in the example programme, but I'm not
sure where to look.
 
Jon,

Yes, when you use the "using" statement at the head of the file, it only
indicates that you don't have to use the namespace-qualified name of a type
in a file (instead of System.String, you can use String, for example).

You actually have to go to the references in your project and add a
reference to the assembly you are trying to use.
 
Thanks for your reply Nicholas.

I've been looking through the VSC# 2005 Express help, and have found out how to add a reference
(Project > Add Reference).

My problem is that I don't know what reference(s) I need to add. I have this example programme that
I've downloaded from the web, and that works OK. I'm trying to work out what references this
programme has. How do I work out what extra references have been added to this example programme?
When I find this out, I can add them to my programme.

Jay


Jon,

Yes, when you use the "using" statement at the head of the file, it only
indicates that you don't have to use the namespace-qualified name of a type
in a file (instead of System.String, you can use String, for example).

You actually have to go to the references in your project and add a
reference to the assembly you are trying to use.
 
I've been looking through the VSC# 2005 Express help, and have found out how to add a reference
(Project > Add Reference).

My problem is that I don't know what reference(s) I need to add. I have this example programme that
I've downloaded from the web, and that works OK. I'm trying to work out what references this
programme has. How do I work out what extra references have been added to this example programme?
When I find this out, I can add them to my programme.

Within a project, there's a "References" item. If you expand that,
you'll see what references a project has. Have a look for the sample
project and you should see what's required.

Jon
 
Ah yes, I've found it now for the example project. I've added the reference to my programme, and it
no longer gives me this error.

I kept looking for a menu option that displayed the references - I must be stuck in the 1990s.

Thanks for your help - Jay


I've been looking through the VSC# 2005 Express help, and have found out how to add a reference
(Project > Add Reference).

My problem is that I don't know what reference(s) I need to add. I have this example programme
that
I've downloaded from the web, and that works OK. I'm trying to work out what references this
programme has. How do I work out what extra references have been added to this example programme?
When I find this out, I can add them to my programme.

Within a project, there's a "References" item. If you expand that,
you'll see what references a project has. Have a look for the sample
project and you should see what's required.

Jon
 
Back
Top