Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I put a dll into my project - visual studio C# 2010

Tags:

I need to put a dll file into my project, my notes say simply drag the dll into the toolbox but it doesn't seem to be working.

How do i do this?

thanks.

like image 724
Dan Avatar asked Sep 08 '11 13:09

Dan


Video Answer


2 Answers

You use the "References" item in the Solution Explorer to add a reference to it; Right-click and choose to Add Reference. There is an option there to select the DLL file.

When you do this, by default the DLL is copied and included in the project's output, which is what you usually want for a .NET Assembly, anyway.

Which reminds me to ask to make sure; Are you talking about a .NET Assembly DLL here? Things could be quite different if you mean a native code DLL.

like image 135
Andrew Barber Avatar answered Sep 30 '22 20:09

Andrew Barber


Put the DLL into the root of your ASP.NET project, then make a regular .NET reference to it. Once you click "Add Reference..." you'll get to the .NET assemblies tab in the reference dialog. Then you click "Browse" which should open up the root directory of the project. In there you'll find the DLL you want to use, select it and ok out of everything. Visual Studio will then copy the DLL into the bin directory for you and the code that uses that assembly will then work.
<%@RegisterAssembly="(DLL Name)"Namespace="(Namespace from Object Browser)"TagPrefix="(Any Prefix)" %>

like image 21
4b0 Avatar answered Sep 30 '22 19:09

4b0