简体   繁体   English

如何在Visual Studio 2010中向项目中正确添加框架?

[英]How to properly add a framework to a project in Visual Studio 2010?

I am going to use a framework from codeproject.com, there are a .dll file and .xml file with the package. 我将使用来自codeproject.com的框架,该软件包中有一个.dll文件和.xml文件。 I added the dll file to my project using Add Reference... and browing for it's location. 我使用“ Add Reference...将dll文件Add Reference...到我的项目中Add Reference...并浏览了其位置。 It got added to references, and I can point to it in my code by using .... 它已添加到引用中,我可以在代码中using ....指向它。

I have 2 questions: 我有两个问题:

  1. There is a XML file in the package that seems to be comments for methods and stuff like that. 程序包中有一个XML文件,其中似乎包含对方法和类似内容的注释。 how can I use this? 我该如何使用呢? (So when I type a method name from that framework its description pop up?) (因此,当我从该框架中键入方法名称时,其描述会弹出吗?)

  2. How can I make sure that when building an install for my project, the dll file will be included there? 我如何确保在为我的项目构建安装时,dll文件将包含在其中?

  1. The XML file containing IntelliSense data should be placed in the same location as the DLL you're using. 包含IntelliSense数据的XML文件应与您使用的DLL放在同一位置。
  2. Select the DLL in your Solution Explorer and open its Properties . 解决方案资源管理器中选择DLL,然后打开其“ 属性” Set Copy Local to True “本地复制”设置为True
  1. After adding a reference to a dll with xml documentation attached, it will be cached and shown to you by Visual Studio's IntelliSense 添加对带有xml文档的dll的引用后,它将被缓存并由Visual Studio的IntelliSense显示给您

  2. Set referenced dll property Copy Local=true to make sure it will be always copied to your project output folder 设置引用的dll属性Copy Local = true以确保将其始终复制到您的项目输出文件夹中

The XML file is documentation file of the dll library. XML文件是dll库的文档文件。 Add reference that dll in your solution with copy local option. 使用复制本地选项在解决方案中添加该dll的引用。

you simply drop it in the same folder as the dll. 您只需将其放在与dll相同的文件夹中即可。

Your question is somewhat same as this one How to use XML documentation files 您的问题与这一问题有些相同。 如何使用XML文档文件

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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