then I get this error:
D:\Builds\Agents\17\DevelopmentSTP1\My.Product\src\before.My.Product.sln.targets (9): The imported project "D:\.build\MSBuild.Community.Tasks.Targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.
The actual path on the build server to the DLL is: D:\Builds\Agents\17\DevelopmentSTP1\EInterface.Service\src\.build , so it looked like $(SolutionDir) was returning a blank, however that made no sense as $(SolutionDir) is used elsewhere in the script successfully.
If I set it like this:
<MSBuildCommunityTasksPath>$(SolutionDir).build</MSBuildCommunityTasksPath> (i.e. without the backslash)
D:\Builds\Agents\17\DevelopmentSTP1\My.Product\src\before.My.Product.sln.targets (18): The "MSBuild.Community.Tasks.Attrib" task could not be loaded from the assembly D:\Builds\Agents\17\DevelopmentSTP1\My.Product\src\.build\.build\MSBuild.Community.Tasks.dll. Could not load file or assembly 'file:///D:\Builds\Agents\17\DevelopmentSTP1\My.Product\src\.build\.build\MSBuild.Community.Tasks.dll' or one of its dependencies. The system cannot find the file specified. Confirm that the <UsingTask> declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask.
The path is almost right now, but note the doubling of the folder name: \.build\.build
I have tried a lot of tricks to try to get it to work, like adding \..\ to try to get it to step back a folder level, but nothing works so long as I retain the $(SolutionDir) variable. The only thing that works is to hard code the physical path in, i.e.
<MSBuildCommunityTasksPath>D:\Builds\Agents\17\DevelopmentSTP1\EInterface.Service\src\.build</MSBuildCommunityTasksPath>
Any ideas how I can make it work without hard-coding a path?
Thanks