Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / October 2007

Tip: Looking for answers? Try searching our database.

Reference to a namespace

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jon - 08 Oct 2007 14:10 GMT
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.
Nicholas Paldino [.NET/C# MVP] - 08 Oct 2007 14:27 GMT
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.

Signature

         - Nicholas Paldino [.NET/C# MVP]
         - mvp@spam.guard.caspershouse.com

>I have an example C# programme which shows me how to communicate with a
>scientist instrument. It
[quoted text clipped - 8 lines]
> example programme, but I'm not
> sure where to look.
Jon - 08 Oct 2007 16:20 GMT
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.

Signature

         - Nicholas Paldino [.NET/C# MVP]
         - mvp@spam.guard.caspershouse.com

"Jon" <.> wrote in message news:eFwdZyaCIHA.4836@TK2MSFTNGP06.phx.gbl...

>I have an example C# programme which shows me how to communicate with a
>scientist instrument. It
[quoted text clipped - 8 lines]
> example programme, but I'm not
> sure where to look.
Jon Skeet [C# MVP] - 08 Oct 2007 16:27 GMT
> I've been looking through the VSC# 2005 Express help, and have found out how to add a reference
> (Project > Add Reference).
[quoted text clipped - 3 lines]
> 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
Jon - 08 Oct 2007 16:57 GMT
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

On Oct 8, 4:20 pm, "Jon" <.> wrote:
> I've been looking through the VSC# 2005 Express help, and have found out how to add a reference
> (Project > Add Reference).
[quoted text clipped - 4 lines]
> 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

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.