Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2008-06-26
3
Medium Priority
?
243 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 11

Accepted Solution

by:
Babycorn-Starfish earned 1500 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

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A basic question.. “What is the Garbage Collector?” The usual answer given back: “Garbage collector is a background thread run by the CLR for freeing up the memory space used by the objects which are no longer used by the program.” I wondered …
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…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…

618 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