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# / March 2008

Tip: Looking for answers? Try searching our database.

using your own class library

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Christopher Pisz - 18 Mar 2008 05:29 GMT
My C# book seems to leave out how to "link" to a class library I created.

I made a project of type class library called "Data Objects" and a project
of type windows application called "Economic Simulation" in the same
solution. Now I want to make use of one of the classes from "Data Objects"
called "Good", which is in Good.cs, in "Economic Simulation".

How do I perform the C++ equivalent of linking in C#?
Peter Duniho - 18 Mar 2008 05:42 GMT
> My C# book seems to leave out how to "link" to a class library I created.
>
[quoted text clipped - 6 lines]
>
> How do I perform the C++ equivalent of linking in C#?

You need to add your library's assembly to the references of the project  
in which you want to use it.  In the Solution Explorer, right-click on  
"References", choose "Add..." and find your project in the "Projects" tab  
in the dialog.  It should be there automatically, but if not my  
recollection is that there's a button that lets you look for it.

Pete
Roger Frost - 18 Mar 2008 11:27 GMT
>> My C# book seems to leave out how to "link" to a class library I created.
>>
[quoted text clipped - 14 lines]
>
> Pete

Sort of related to your question and sort of not, but....

For simplicity's sake, you can also add a using statement for the namespace
of your library, if different than the project you working on.  Note that
"using" and "referencing" are independent of each other.

So if you include a "using Foo.Bar;" statement at the top of your .cs
file...

you can type MyClass

...rather than Foo.Bar.MyClass

...and intellisense gets it.

Signature

Roger Frost
"Logic Is Syntax Independent"

Christopher Van Kirk - 18 Mar 2008 14:22 GMT
the using statement doesn't work unless you have a reference to the dll or
project in your project.

>>> My C# book seems to leave out how to "link" to a class library I
>>> created.
[quoted text clipped - 30 lines]
>
> ...and intellisense gets it.

Signature

Posted via a free Usenet account from http://www.teranews.com

Roger Frost - 18 Mar 2008 21:47 GMT
Good call Christopher.  Independent was the wrong word.  I assumed Peter's
steps would have been taken prior to adding the using statement.

Signature

Roger Frost
"Logic Is Syntax Independent"

> the using statement doesn't work unless you have a reference to the dll or
> project in your project.
[quoted text clipped - 33 lines]
>>
>> ...and intellisense gets it.

Rate this thread:







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.