开发者

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

开发者 https://www.devze.com 2023-03-01 05:01 出处:网络
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 theprogram in c#.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:

  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

0

精彩评论

暂无评论...
验证码 换一张
取 消