Now that I’m coordinating the Tinkr Open Source project I wanted to generate the API docs with Sandcastle.
So I downloaded the latest version of SHFB, installed it and added the SHFB project to the solution.
Setting everything up is quite easy if you are not doing it for the 1st time.
Unfortunately support for every single .NET Framework version needs to be built into SHFB. Unsurprisingly NETMF was not included.
After a short search in the SHFB issues I found that I’m not the only one with this problem. And one had already made a small step In the right direction to solve it, but got stuck then.
I tried to do the same and it worked for me.
Compilation of the docs could be started, but the references to the NETMF assemblies could not be found.
After a little sneaking around the settings I found a preinstalled plug in to ignore unresolved references. All I needed to do was activating the plug in and adding the NETMF assemblies to it.
Now I can generate the API docs automatically from xml-doc comments in VS
Here is a detailed description:
- Locate the Frameworks.xml file which is normally located in C:\Program Files (x86)\EWSoftware\Sandcastle Help File Builder
Open it and add the following to the Frameworks element (remember to start editor with admin rights or you can not save)
<Framework Platform=".NETMicroFramework" Version="4.2.0.0" Title=".NETMicroFramework 4.2">
<AssemblyLocations>
<Location IsCore="true" Path="%ProgramFiles(x86)%\Reference Assemblies\Microsoft\Framework\.NETMicroFramework\v4.2">
<AssemblyDetails Filename="MFDpwsClient.dll" Name="MFDpwsClient" Version="4.2.0.0" PublicKeyToken="2670f5f21e7f4192"/>
<AssemblyDetails Filename="MFDpwsDevice.dll" Name="MFDpwsDevice" Version="4.2.0.0" PublicKeyToken="2670f5f21e7f4192"/>
<AssemblyDetails Filename="MFDpwsExtensions.dll" Name="MFDpwsExtensions" Version="4.2.0.0" PublicKeyToken="2670f5f21e7f4192"/>
<AssemblyDetails Filename="MFUpdate.dll" Name="MFUpdate" Version="4.2.0.0" PublicKeyToken="2670f5f21e7f4192"/>
<AssemblyDetails Filename="MFWsStack.dll" Name="MFWsStack" Version="4.2.0.0" PublicKeyToken="2670f5f21e7f4192"/>
<AssemblyDetails Filename="Microsoft.SPOT.Graphics.dll" Name="Microsoft.SPOT.Graphics" Version="4.2.0.0" PublicKeyToken="2670f5f21e7f4192"/>
<AssemblyDetails Filename="Microsoft.SPOT.Hardware.dll" Name="Microsoft.SPOT.Hardware" Version="4.2.0.0" PublicKeyToken="2670f5f21e7f4192"/>
<AssemblyDetails Filename="Microsoft.SPOT.Hardware.OneWire.dll" Name="Microsoft.SPOT.Hardware.OneWire" Version="4.2.0.0" PublicKeyToken="2670f5f21e7f4192"/>
<AssemblyDetails Filename="Microsoft.SPOT.Hardware.PWM.dll" Name="Microsoft.SPOT.Hardware.PWM" Version="4.2.0.1" PublicKeyToken="2670f5f21e7f4192"/>
<AssemblyDetails Filename="Microsoft.SPOT.Hardware.SerialPort.dll" Name="Microsoft.SPOT.Hardware.SerialPort" Version="4.2.0.0" PublicKeyToken="2670f5f21e7f4192"/>
<AssemblyDetails Filename="Microsoft.SPOT.Hardware.Usb.dll" Name="Microsoft.SPOT.Hardware.Usb" Version="4.2.0.0" PublicKeyToken="2670f5f21e7f4192"/>
<AssemblyDetails Filename="Microsoft.SPOT.Ink.dll" Name="Microsoft.SPOT.Ink" Version="4.2.0.0" PublicKeyToken="2670f5f21e7f4192"/>
<AssemblyDetails Filename="Microsoft.SPOT.IO.dll" Name="Microsoft.SPOT.IO" Version="4.2.0.0" PublicKeyToken="2670f5f21e7f4192"/>
<AssemblyDetails Filename="Microsoft.SPOT.Native.dll" Name="Microsoft.SPOT.Native" Version="4.2.0.0" PublicKeyToken="2670f5f21e7f4192"/>
<AssemblyDetails Filename="Microsoft.SPOT.Net.dll" Name="Microsoft.SPOT.Net" Version="4.2.0.0" PublicKeyToken="2670f5f21e7f4192"/>
<AssemblyDetails Filename="Microsoft.SPOT.Net.Security.dll" Name="Microsoft.SPOT.Net.Security" Version="4.2.0.0" PublicKeyToken="2670f5f21e7f4192"/>
<AssemblyDetails Filename="Microsoft.SPOT.RPC.dll" Name="Microsoft.SPOT.RPC" Version="4.2.0.0" PublicKeyToken="2670f5f21e7f4192"/>
<AssemblyDetails Filename="Microsoft.SPOT.Security.PKCS11.dll" Name="Microsoft.SPOT.Security.PKCS11" Version="4.2.0.0" PublicKeyToken="2670f5f21e7f4192"/>
<AssemblyDetails Filename="Microsoft.SPOT.Time.dll" Name="Microsoft.SPOT.Time" Version="4.2.0.0" PublicKeyToken="2670f5f21e7f4192"/>
<AssemblyDetails Filename="Microsoft.SPOT.TinyCore.dll" Name="Microsoft.SPOT.TinyCore" Version="4.2.0.0" PublicKeyToken="2670f5f21e7f4192"/>
<AssemblyDetails Filename="Microsoft.SPOT.Touch.dll" Name="Microsoft.SPOT.Touch" Version="4.2.0.0" PublicKeyToken="2670f5f21e7f4192"/>
<AssemblyDetails Filename="Microsoft.SPOT.Update.dll" Name="Microsoft.SPOT.Update" Version="4.2.0.0" PublicKeyToken="2670f5f21e7f4192"/>
<AssemblyDetails Filename="Microsoft.VisualBasic.dll" Name="Microsoft.VisualBasic" Version="1.0.0.0" PublicKeyToken="2670f5f21e7f4192"/>
<AssemblyDetails Filename="mscorlib.dll" Name="mscorlib" Version="4.2.0.0" PublicKeyToken="2670f5f21e7f4192"/>
<AssemblyDetails Filename="System.dll" Name="System" Version="4.2.0.0" PublicKeyToken="2670f5f21e7f4192"/>
<AssemblyDetails Filename="System.Ftp.dll" Name="System.Ftp" Version="4.2.0.0" PublicKeyToken="2670f5f21e7f4192"/>
<AssemblyDetails Filename="System.Http.dll" Name="System.Http" Version="4.2.0.0" PublicKeyToken="2670f5f21e7f4192"/>
<AssemblyDetails Filename="System.IO.dll" Name="System.IO" Version="4.2.0.0" PublicKeyToken="2670f5f21e7f4192"/>
<AssemblyDetails Filename="System.Net.Security.dll" Name="System.Net.Security" Version="4.2.0.0" PublicKeyToken="2670f5f21e7f4192"/>
<AssemblyDetails Filename="System.Security.dll" Name="System.Security" Version="4.2.0.0" PublicKeyToken="2670f5f21e7f4192"/>
<AssemblyDetails Filename="System.Text.RegularExpressions.dll" Name="System.Text.RegularExpressions" Version="0.0.0.0" PublicKeyToken="2670f5f21e7f4192"/>
<AssemblyDetails Filename="System.Xml.dll" Name="System.Xml" Version="4.2.0.0" PublicKeyToken="2670f5f21e7f4192"/>
<AssemblyDetails Filename="System.Xml.Legacy.dll" Name="System.Xml.Legacy" Version="4.2.0.0" PublicKeyToken="2670f5f21e7f4192"/>
</Location>
</AssemblyLocations>
</Framework>
-
Restart Visual Studio
-
Change the Framework version in the help project properties to '.NETMicroFramework 4.2’
see image 1 -
Activate the ‘Assembly Build Redirection’ plugin.
see image 2 -
Add all NETMF Framework assemblies to the ‘Ignore if Unresolved’ tab
see image 3
That’s it, now you should be able to generate your api doc for NETMF projects.
To support 4.3 (or 4.1) it should work too.
The PublicKeyTokens can be found in:
"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETMicroFramework\v4.2\RedistList\FrameworkList.xml"
and similar for other versions.