Providing IntelliSense for the MSBuild Extension Pack Tasks


The next release of the MSBuild Extension Pack will offer IntelliSense for all tasks. It’s a small but helpful addition which makes using the tasks that little bit easier.

image

We will also ship an IntelliSense schema file for the Team Foundation Build Tasks.

image

In generating this schema file, a few undocumented properties were discovered that you may find useful:

    • Get: TeamFoundationServerUrl, Overwrite
    • Label: TeamFoundationServerUrl, Scope
    • SetBuildProperties: LogLocation, SourceGetVersion

Required parameters have ‘REQUIRED.’ as a prefix in the tooltips shown.

Unfortunately a bug exists in Visual Studio 2008 & SP1 which means that you will partially lose IntelliSense in the IDE if you use schema documented tasks after undocumented tasks. Here is a quick repro:

This repro uses the following simple sample

  1. <Project DefaultTargets=”IntelliPain” ToolsVersion=”3.5″ xmlns=”http://schemas.microsoft.com/developer/msbuild/2003″&gt;
  2.     <Target Name=”IntelliPain”>
  3.         <UnDocumentedTask AProperty=”a”/>
  4.     </Target>
  5. </Project>

Step 1

  • Start typing at Line 4.
  • IntelliSense on the available tasks is seen.

clip_image002[4]

  • Continue typing at Line 4.
  • IntelliSense on the available tasks parameters is seen.
  • CTRL-SPACE can be used to display the parameter IntelliSense if it is not shown.

clip_image004[4]

Step 2

  • Start typing at Line 6 (i.e. BELOW the task which has no associated schema).
  • IntelliSense on the available tasks is seen.

clip_image006[4]

  • Continue typing at Line 6
  • IntelliSense on the available tasks parameters is NOT seen.
  • CTRL-SPACE can NOT be used to display the parameter IntelliSense.

clip_image008[4]

This bug has been reported to Microsoft but I don’t know when we can expect a fix. A workaround is to create documentation schema files for all the tasks you write (and use if they don’t already have them). There is some guidance for doing this here, and you will find more guidance in the next version of the MSBuild Extension Pack help file.

If you would like to try out these schema files now, you can download pre-release versions from the CodePlex site.

One thought on “Providing IntelliSense for the MSBuild Extension Pack Tasks

  1. Pingback: The Friendly Coder » MSBuild: Visual Studio Intellisense » The Friendly Coder

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s