Link to home
Start Free TrialLog in
Avatar of angelsofgrace2006
angelsofgrace2006Flag for Portugal

asked on

c#: What is teh right way to adda new .dll as reference ?

Hi,

I'm working on this CMS (a website) in C# that has several .dll files in the Bin directory.

I've coded a .dll myself, but although I get no errors, it's not working. I suppose it might be because I'm not adding my .dll as a new reference in the proper way.

What I did is to compile it as a new project, copy the resulting .dll to the site's Bin directory and then in VS 2008 right-click on the root directory of the site and chose "Add Reference...".
In the dialog box, it's not in ".NET", "COM" or "Projects". So, I chose "Browse", point to the site's "Bin" directory and select it.

So, my question is: is this the right way to do it ? Something is missing ?
I had another previous version, that i simply deleted. I found no option in VS 2008 to remove the reference whatsoever.

Is this an issue ?

On another note, the "Build solution", only gives me the .dll in the debug directory, I got no "Bin" directory with the .dll
How do I do this ?

Any help would be appreciated.

Warm Regards,
Mário Gamito
ASKER CERTIFIED SOLUTION
Avatar of Babycorn-Starfish
Babycorn-Starfish
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of angelsofgrace2006

ASKER

Hi,

No, I haven't it there.
So, how to add it as a reference in the right way ?

Warm Regards,
Mário Gamito
Okay,

I do it like this (assuming its a .Net dll, although there's no real difference just different tabs)

1) Right mouse click on References in the Solution Explorer pane in Visual Studio, you'll see a context menu appear with the options Add Reference.... and Add Web Reference.... choose the first option

2) A form will be displayed with tabs .Net, COM, Projects, Browse, Recent, click on the Browse tab

3) The form will shift to the Browse tab and from here you can navigate to where the dll is that you want to add using the familiar 'explorer' interface, find your dll then click okay.

4) The form will close and you'll be back to your IDE, if it's not already expanded click on the + symbol next to references and you'll see a list of all of the references in your solution, System, System.Data etc, you should see the dll that you added.

5) Thats it really, if you're referencing code within the dll then you'll need to add the usual using statements to the top of your code.

Any more probs post back here, good luck