how to programmatically add targets to a DocSite

Topics: Conceptual Topics, DocSites, General Discussion, General Questions
Apr 19, 2010 at 6:18 PM
Edited Apr 19, 2010 at 6:21 PM
All -- Please help. I need to know how to programmatically add targets to a DocSite. My plan is the following, which is scheduled-integration. (1). Create a DocSite and host it on our source control server machine's IIS. (2). Create a Scheduled Task that will run every N minutes, calling a fire-and-forget help-doc-builder. (3). The help-doc-builder will get latest of every project, build every project and put output DLL-files and XML-comment-files into a known location, and "skip" each project that does not build. (4). The help-doc-builder will programmatically add targets to a DocSite. (5). The help-doc-builder will build the DocSite. (6). The help-doc-builder will publish the DocSite. (7). The DocSite will be live with a (more or less) fresh version of our company's complete API. (8). Done. (Note that we are not ready for continuous-integration right now; so, we are looking for something dirt-simple, GEFN.) What do you think? Is the plan sound? Can it be done with DocSite? Please advise. Thank you. -- Mark Kamoski
Apr 21, 2010 at 4:26 PM

Hi Mark,

What exactly do you mean by "targets"?  Do you mean assemblies and XML documentation files?  I typically refer to them as "sources" instead.

If you're looking for a way to add sources to your DocSite dynamically, I'd instead recommend configuring your DocSite to include all assemblies and XML documentation files found in a particular folder.  To add a folder as a documentation source, use the Build > External sources property in the DocProject Properties window.  The first column allows you to specify a directory, with wildcards, where assemblies will be located.  You may include a path that is relative to the DocSite project file.  The second column allows you to do the same for XML documentation files.

- Dave

Apr 21, 2010 at 4:32 PM
Dave -- Yes, I should have said "sources". Your solution is excellent, as stated above. It will work perfectly for our needs right now. Thank you. -- Mark Kamoski