Solved

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

Posted on 2008-06-26
3
228 Views
Last Modified: 2013-12-16
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
0
Comment
Question by:angelsofgrace2006
  • 2
3 Comments
 
LVL 11

Accepted Solution

by:
Babycorn-Starfish earned 500 total points
ID: 21873932
Hi,
 
after you've added the dll to your project, can you browse the dll? Go to View->Object Browser or View->Other Windows->Object Browser this should provide a tree view of all namspaces you have in your project, the one you have added should be listed if it has been successfully added.
0
 

Author Comment

by:angelsofgrace2006
ID: 21874092
Hi,

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

Warm Regards,
Mário Gamito
0
 
LVL 11

Expert Comment

by:Babycorn-Starfish
ID: 21877765
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
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Suggested Solutions

In my previous article (http://www.experts-exchange.com/Programming/Languages/.NET/.NET_Framework_3.x/A_4362-Serialization-in-NET-1.html) we saw the basics of serialization and how types/objects can be serialized to Binary format. In this blog we wi…
For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now