473,322 Members | 1,379 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Reference to a namespace

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.
Oct 8 '07 #1
4 4333
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.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Jon" <.wrote in message news:eF**************@TK2MSFTNGP06.phx.gbl...
>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.

Oct 8 '07 #2
Jon
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
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.comwrote in message
news:1C**********************************@microsof t.com...
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.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Jon" <.wrote in message news:eF**************@TK2MSFTNGP06.phx.gbl...
>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.


Oct 8 '07 #3
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).

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

Oct 8 '07 #4
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
"Jon Skeet [C# MVP]" <sk***@pobox.comwrote in message
news:11*********************@r29g2000hsg.googlegro ups.com...
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).

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
Oct 8 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Whoever | last post by:
To create Excel file, you can Add Reference Visual Studio.NET, browse to ... and then select Microsoft.Office.Interop.Excel, etc. It endsup some reference to GUID in project file. You can then...
2
by: Steve Harclerode | last post by:
Hi all, I've been doing web service development for a year, with a break for the last few months. What I remember is how easy it is to reference a web service using Visual Studio. So today, I...
5
by: Greg Collins [MVP] | last post by:
I have an ASP.NET page that uses a tag: <asp:Xml id="foo" runat="server" DocumentSource="rss.xml" TransformSource="rss20.xsl" /> This creates a Web page from an XML file that was generated by...
4
by: dhnriverside | last post by:
HI guys I've just written my first independent namespace for my library (yay me!). However, on trying to add it to my website project, it causes an error when I look at the website. It compiles...
3
by: Adam | last post by:
We have a web site that uses .vb for the web pages and .cs for a class module. We are getting the error in .NET 2.0 and VS 2005 beta 2. It does work with .NET 1.1. When trying to access a page...
1
by: Jim Heavey | last post by:
Hello, I am trying to understand how to properly use the "reference" and "imports". If I create a "solution" with 2 projects, do they both sare the same namespace? When I use the IDE to...
5
by: Derek Martin | last post by:
I am creating a windows service and have added a reference to a DLL project that I have created. That DLL file is correctly referenced in both a windows app and a web app, all in the same...
9
by: MSDNAndi | last post by:
Hi, I have the following problem with VS 2005 (Professional) and C# 2.0 I will use assembly and namespace synonymously here. I have a class in namespace InheritClass inherit from a baseclass...
12
by: Bryan Parkoff | last post by:
I write my large project in C++ source code. My C++ source code contains approximate four thousand small functions. Most of them are inline. I define variables and functions in the global scope....
275
by: Astley Le Jasper | last post by:
Sorry for the numpty question ... How do you find the reference name of an object? So if i have this bob = modulename.objectname() how do i find that the name is 'bob'
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.