MSDN tells about MSBuild project importing:
All relative paths in imported projects are interpreted relative to the directory of the importing project.
Well, is it just that i need?
I need to import MSBuild.Community.Tasks.targets file, that describes Zip task.
MSBuildCommunityTasks.targets defines property MSBuildCommunityTasksPath, that can be used to locate MSBuild.Community.Tasks assembly.
In my case, MSBuild.Community.Tasks is not installed to default location, but placed not far from project directory, by some relative path (..\externals\MSBuildCommunityTasks).
I try to replace default value of property MSBuildCommunityTasksPath just before import:
<Import Project="..\externals\MSBuildCommunityTasks\MSBuild.Community.Tasks.targets" />
But on msbuild run, the error occurs:
error MSB4062: The "MSBuild.Community.Tasks.Zip" task could not be loaded from the assembly D:\PROJECT-ROOT-PATH\externals\MSBuildCommunityTasks\..\externals\MSBuildC
That looks like MSBuild try to interpred path from property MSBuildCommunityTasksPath not relative to the primary, importing project (as MSDN defines), but relative to imported project, MSBuild.Community.Tasks.targets.
How i can import MSBuild.Community.Tasks.targets by relative path (..\externals\MSBuildCommunityTasks), and give it the property MSBuildCommunityTasksPath, containing the relative path to the same directory (..\externals\MSBuildCommunityTasks), so, that MSBuild.Community.Tasks.targets can use this path correctly?