user601367
user601367

Reputation: 2368

how access the dll in sub directory of bin . .net?

i am adding a new folder to bin in solution explorer in vs 2010 and in that folder i am having one dll file and i want to access that dll file in the program in c#.net? i used using in code but i did not get the intelligence of that dll . please help me ?

Upvotes: 0

Views: 619

Answers (3)

Shirsendu
Shirsendu

Reputation: 16

I am assuming you asking about web solutions. In web solutions bins doesn't have any sub folder. All the dlls reside just in the bin itself.

So drop the dll directly in bin...rebuild the full solution and you will get what you want.

Thanks

Upvotes: 0

Louis Waweru
Louis Waweru

Reputation: 3672

Try adding it as a reference.

In Solution Explorer, right-click the project node and click Add Reference.

In the Add Reference dialog box, browse to it.

How to: Add or Remove References in Visual Studio (MSDN)

Upvotes: 3

Dirk Vollmar
Dirk Vollmar

Reputation: 176159

Don't add files to the target bin folder of your solution as this folder is controlled by Visual Studio.

If the library is a .NET or COM library add it as a reference.

If the libary is a native dll do the following:

  1. Add the file to your project
  2. Set the Build Action property to Content
  3. Set the Copy to Output Directory property to Copy always

Then Visual Studio will make sure that the library gets copied to the target folder automatically where you can access it.

Upvotes: 0

Related Questions