Visual studio comments from a dll project

删除回忆录丶 提交于 2020-01-03 04:17:28

问题


When I write code I frequently use comment notation like below.
For functions / methods / classes and sometimes even for public variables.

    /// <summary>
    /// Constructor of the process runner class.
    /// </summary>
    /// <param name="Name">The exe name of the application ea notead.exe</param>
    /// <param name="Processrunner">A Process instance to start</param>
    Public ProcesRunner(.....bla bla bla..

This works nice when both class and program are within the same project.

However when I create a .dll project those comments seem to get lost, when I use such dll inside a new project. Is there something that I should add to those projects (maybe in lib folder?) to get the comments back?

So that I'll be able to use intellisense as well on these dll's.


回答1:


Generate a XML documentation for your project (your dll), see https://msdn.microsoft.com/en-us/library/x4sa0ak0(v=vs.100).aspx.

The following steps are needed:

  1. With a project selected in Solution Explorer, on the Project menu, click Properties.
  2. Click the Build tab.
  3. On the Build page, select XML documentation file. By default, the file is created under the specified output path, for example, "bin\Debug\Projectname.XML".

Now if you use your dll in another solution, and you've built as well the XML documentation file for it, then Intellisense will work for your dll.




回答2:


To make the XML comment for use with the intellisense feature, please follow the steps as below:

  1. Generate the .XML documentation for your code, right click the Project name>Properties>Build>Output and check the option “XML documentation file:”, make sure the file name of the .xml file be the same as the assembly you want to support and save it, then build this solution

  2. To use the generated .xml file for use with the IntelliSense feature, let the .xml file is in the same directory as the assembly, I copied this 2 files into another solution and test this feature and the intellisense with XML comment works fine as following:



来源:https://stackoverflow.com/questions/46669034/visual-studio-comments-from-a-dll-project

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!