Using class libraries..


N

Nico Vrouwe

Hi,

I'm pretty new to C# and .NET and I'm just wondering, is it supposed to
be so complicated to use class libraries in VS.NET?

I'm working on a project now and I got 2 libraries and a GUI that uses
both libraries. One of them is a general utility library and the other
library also depends on that one.
I had everything in the same project before (having the stuff that is in
the libs now in a subdir) and that actually worked fine. But now I
figured I'd create seperate projects for them, like I was used to do in
VC6. So I did, and set the right dependencies and I figured I was done.
All that remains is doing a rebuild.
NOT! Nothing would compile, not even the utility library that didn't
depend on anything. I figured out why and added the right stuff in
References, so now the utility lib compiled fine. On to the next one.
Here I had to manually add the utility dll in the references? Same goes
for the GUI, where I manually had to add both libs.

I must say I'm absolutely stunned, I just can't believe this. What
happened to the friendlyness of VC6? Just add a project to the
workspace, set dependencies and everything would compile. No need to
change libraries for Debug/Release mode, it was all done automatically.

Do I really have to manually add the references? What if I compiled the
lib in Debug mode and want to make a Release version of my GUI? Do I
have to change the References to a Release dll? As if this wasn't bad
enough yet, I end up with 3 copies of the utility library. One in the
bin dir of the utility project, the bin dir of the other lib, and one in
the bin dir of the GUI.

I'm sure I must be missing something here.
Please someone tell me all this isn't true and that there's an easy
solution.

Thanks in advance,

Nico Vrouwe
 
Ad

Advertisements

P

Paul E Collins

[adding references to DLLs]

I always add references to projects, not DLLs. One project can appear in
multiple solutions, and you won't have the problems with debug/release and
mismatched version numbers that might come up when using DLLs.

P.
 
Ad

Advertisements

N

Nico Vrouwe

Ahhh!
I knew I missed something :) I totally overlooked the projects tab..

Thanks!
/Nico


Paul E Collins said:
[adding references to DLLs]
I always add references to projects, not DLLs. One project can appear in
multiple solutions, and you won't have the problems with debug/release and
mismatched version numbers that might come up when using DLLs.

P.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top