tags:

views:

336

answers:

1

Is there a way to use the MSBuild Extension Pack with a "local" reference that doesn't require you to run the installer? In other words, can you store the targets in a solution items folder so that every developer doesn't have to install it?

+2  A: 

You have to declare the property, ExtensionTasksPath, before the import statment for the tasks. For example take a look at:

<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"&gt;
  <PropertyGroup>
    <ExtensionTasksPath Condition="'$(ExtensionTasksPath)' == ''">E:\Data\Development\My Code\Community\MSBuild\ExtensionPack\</ExtensionTasksPath>
  </PropertyGroup>

  <Import Project="$(ExtensionTasksPath)MSBuild.ExtensionPack.tasks"/>

  <Target Name="Demo">
    <MSBuild.ExtensionPack.FileSystem.File TaskAction="GetTempFileName">
      <Output TaskParameter="Path" PropertyName="TempPath"/>
    </MSBuild.ExtensionPack.FileSystem.File>

    <Message Text="TempPath: $(TempPath)" />
  </Target>

</Project>

The MSBuild Community tasks is similar but the proerty is named MSBuildCommunityTasksLib. I think for SDC tasks its called TasksPath.

Sayed Ibrahim Hashimi
Thank you! I just watched your DNRtv episodes on MSBuild and they were fantastic.
Bob