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 开发者_Python百科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:
- Add the file to your project
- Set the Build Action property to Content
- 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
精彩评论