Avoiding Local Dependencies for MSBuild Community Tasks in Visual Studio 2010

I'm trying to start using MSBuild Community Tasks , so right after installing the .msi package, I imported MSBuild.Community.targets into the <Project> element as follows:

 <Import Project="lib\MSBuild.Community.Tasks.targets" /> 

Interestingly, I noticed that such a file has a link to the local installation path in MSBuildExtensionsPath and provided that instead of saving the code dependencies as clean as possible, Iā€™m ready to pay the distribution overhead / version with each project, I was interested to know is it possible to override the default location / installation with relative to the project in the .cproj file?

The actual layout will look like this:

 Dotnet.Samples.Foobar \src Foobar.cs \lib MSBuild.Community.Tasks.targets MSBuild.Community.Tasks.dll 

Any guidance would be truly appreciated. Many thanks to advace for any suggestion you might want to share.

+6
source share
1 answer

In MSBuild.Community.Tasks.targets the path to the dll is specified.

 <PropertyGroup> <MSBuildCommunityTasksPath Condition="'$(MSBuildCommunityTasksPath)' == ''">$(MSBuildExtensionsPath)\MSBuildCommunityTasks</MSBuildCommunityTasksPath> <MSBuildCommunityTasksLib>$(MSBuildCommunityTasksPath)\MSBuild.Community.Tasks.dll</MSBuildCommunityTasksLib> </PropertyGroup> 

You can redefine the path in the project.

 <PropertyGroup> <MSBuildCommunityTasksPath>lib</MSBuildCommunityTasksPath> </PropertyGroup> 

And leave the import the same:

 <Import Project="lib\MSBuild.Community.Tasks.targets" /> 
+7
source

Source: https://habr.com/ru/post/885620/


All Articles