Final update
Sorry, I’m not able to figure out what’s wrong with this, and since Frank has a better solution for Visual Studio integration, I’m cancelling this attempt. If you’re interested in the source code, send me an email! I think it’s better if I focus my efforts on the MSBuild script instead.
Update 3
Have a look at Frank Kroondijk’s Sandcastle plugin. It seems to work much better (at least looking at the video – I haven’t installed it yet).
Update 2
It seems there is still a bug of some sort that gives you an error message when creating a project. I’d recommend that you hold off on installing this until I can find a solution.
Update
There was a file missing in the msi-package, so you’ll have to uninstall the old version and repeat steps 2 and 3 below in order for it to work properly.
As I hinted in yesterdays post, I’ve been working on a Visual Studio plugin for the Sandcastle MSBuild-script, and today I’m happy enough with it to share it with the community. Be warned though, this is my first attempt at a VS project plugin, and it is most likely rather unstable so please realize the risks of installing it (worst-case scenario, you’ll have a broken Visual Studio).. That said, it works ok for me and uninstalling it seems to be fine too.
Installation instructions:
- Prerequisites: Visual Studio 2005 (Standard edition or better) and an unmodified version of Sandcastle.
- You’ll need the latest version (updated a few minutes ago) of the Sandcastle MSBuild-script.
- Download and install the SandcastleProjectSetup.msi-package.
- Open up a Visual Studio 2005 Command Prompt (you’ll find it on the Start menu under your Visual Studio Tools-folder) and run the following command:
devenv.exe /setup
Usage:
After installing the package, a new Project type is available from the New/Add project dialog. Typically, you’ll add this project to an existing solution.
In order to bring up the main settings page, you simpy right-click the newly added project and select Properties. This is where you select which assemblies and documentation files you wish to include. You can include files from the current solution by clicking the Select button, or external files by clicking the Add button.
Finally, to actually build your documentation file, right click the project and select “Build”. The documentation will (if everything works as planned) end up in the a subfolder to the documentation project called Output.
If you get an error from the build engine, the best way to find out what’s wrong is to run the build outside of Visual Studio. You do that simply by running MSBuild on the [ProjectName].sandproj file. The most common error is probably an Unresolved Assembly Reference. Currently, you can only add dependencies manually to the .sandproj file. You’ll have to unload the project to do so.
Comments are always appreciated! If you’re interested in the (not-so-pretty) source code for this, why not send me an email! You’ll need the Visual Studio SDK (April 2006) installed for it to compile though. The address is: andlju (at) gmail (dot) com.
Leave a Reply