简体   繁体   中英

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?

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)

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM