I have a project in which the NuGet package is installed under MSBuildTasks . It installs two files: MSBuild.Community.Tasks.targets and MSBuild.Community.Tasks.dll in the .build directory in the solutions directory. This link to the package is added to the packages.config file in this project directory, so when I create the project (and with the NuGet package recovery settings turned on), it will restore the package, which works great, because then I can distribute the source to another developers and build it on our build server without any missing files ...
However, the problem is that when NuGet restores the package, it does not restore these two files to the expected location, it was originally when I first installed it using the Install-Package MSBuildTasks , which was in $(SolutionDir)\.build . Instead, he installed it in the $(SolutionDir)\packages\MSBuildTasks.1.4.0.78\tools , so now if I want to include the MSBuild.Community.Tasks.targets file, I have to fully reference this path in my .csproj or another .targets file. This creates a problem, as the version number will undoubtedly change, requiring manual correction.
Is there a way to restore the MSBuildTasks.targets and .dll files to the original location $(SolutionDir)\.build , where is it installed first? The current restore behavior in the package directory, while it makes sense for other packages, seems to be an error for this particular package, because I will not know the version number of the directory that will be included in my other .targets or. Csproj files.
source share