开发者

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

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 w开发者_JS百科orking.

How do i do this?

thanks.


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.


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)" %>

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜