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#?
> 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.