Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to generate documentation using Sandcastle NuGet package (EWSoftware.SHFB)?

I am trying to generate website documentation for my C# code using the NuGet package of Sandcastle in Visual Studio (EWSoftware.SHFB). The fact is that I don't know how to use it. I install it from the NuGet package manager and then I have no idea what to do with it.

I have no problem to edit my documentation project and to generate the corresponding website using the VS Sandcaslte extension installed with the default installer.

Thank you for your help.

like image 417
Numid Avatar asked Nov 12 '15 09:11

Numid


2 Answers

Assuming that you already have a solution with a project, add a new project of type 'Documentation' to your solution.

enter image description here

Right-click Documentation Sources and add a source by selecting the csproj you wish to document.

enter image description here

Then just build.

like image 188
Frank Avatar answered Sep 20 '22 17:09

Frank


MsBuild.exe MyDocumentationProject.shfbproj generated the documentation. It means that the project can not be edited via VS, but it can be generated using the command line.

Beforhand, as stated at https://github.com/EWSoftware/SHFB/blob/master/NuGet/ReadMe.txt:

  1. the ComponentPath property must be set in MyDocumentationProject.shfbproj to provide reflection information regarding the framework you are using.

    <PropertyGroup>
      <ComponentPath>$(MSBuildThisFileDirectory)..\packages\EWSoftware.SHFB.NETFramework.4.6</ComponentPath>
    </PropertyGroup>
    
  2. The SHFB environment variable must be set conditionally in MyDocumentationProject.shfbproj.

    <PropertyGroup>
      <SHFBROOT Condition=" '$(SHFBROOT)' == '' ">$(MSBuildThisFileDirectory)..\packages\EWSoftware.SHFB.2015.10.10.0\Tools\</SHFBROOT>
    </PropertyGroup>
    
like image 21
Numid Avatar answered Sep 18 '22 17:09

Numid