June 19, 2008

DocProject 2008: Custom Visual Studio Project System

For the last couple of weeks I've been testing a new VS package for DocProject 2008.  You can read more about my plans here.

More recently I've been working on a new project system that integrates into Visual Studio 2008 but the current implementation only provides a single template, .docproj, which has very limited functionality at the moment.  I'm considering whether I shouldn't bother creating a custom project system if I can't do what I want since the current implementation (zipped templates copied to a folder during installation) provides seamless integration into VS already and won't require me to invest any more development time in this area.

However, I'd really like to have a custom project system that inherits from the project system that VS provides for the C# and VB.NET class library/web application templates since it will provide the following advantages to DocProject:

  1. Inherit all of the functionality provided by .csproj and .vbproj, including full support for the class library and web application project sub types.  (I'm considering using .csdoc and .vbdoc as the new file extensions.)
  2. I have lots of tested automation code that works against the VSProject system already (provided by EnvDTE).  It could be reused with only minimal changes, if any at all.  This will mean that I'll be able to deploy the next release much sooner and with minimal impact to DocProject's existing codebase.
  3. I could get rid of the DocProject Properties command and tool window and instead integrate the property grid into the typical Properties window by adding a new tab named, DocProject.
  4. Use custom MSBuild properties to store project options instead of using the automation Globals collection, which stores all custom data as attributes on a UserProperties element.  Using actual MSBuild properties provides the obvious advantage of being able to easily set project settings for command-line builds and also has the advantage of being able to make certain properties dependent on the active solution configuration.  (The latter point has been a feature that I've been considering for a while but I've felt that it's not worth the effort to implement if I have to roll my own solution via automation code, so it's been deferred until DocProject 2008.)
  5. Create special project folders that have a different appearance and provide custom behavior when double-clicked; like the Properties folder for example.  In DocProjects and DocSites, the Help folder would probably be a good candidate for a different appearance.  The Comments, Settings and Topics folders could probably have a different appearance and behavior.

I've posted a few questions to the VSX forum in the hopes that someone could give me some pointers as to how I can accomplish my goal of implementing a partially custom project system in Visual Studio 2008; i.e., a system that inherits from the VSProject system that can be automated through the EnvDTE library.  If anyone can answer my questions I'd really appreciate it so that I can make a decision about whether a custom project system is worth the effort for the next Beta release.  Thanks :)

Add comment