Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to use MSBuild Extension Pack without installation?

Tags:

.net

msbuild

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?

like image 650
Bob Avatar asked Nov 21 '09 22:11

Bob


1 Answers

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">
  <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 property is named MSBuildCommunityTasksLib. I think for SDC tasks its called TasksPath.

like image 109
Sayed Ibrahim Hashimi Avatar answered Oct 02 '22 13:10

Sayed Ibrahim Hashimi