Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NuGet package no longer aligned with the 'Getting Started' guide. #258

Open
NeoXtreem opened this issue Mar 29, 2017 · 5 comments
Open

NuGet package no longer aligned with the 'Getting Started' guide. #258

NeoXtreem opened this issue Mar 29, 2017 · 5 comments

Comments

@NeoXtreem
Copy link

Version 1.5 of the NuGet package no longer has the PowerShell script that adds the .build folder; yet the 'Getting Started' guide still says to reference this folder if using NuGet to get MSBuildTasks. Is there an alternative method to use MSBuildTasks via NuGet? If so, the documentation should be updated. Otherwise, reinstate the PowerShell script.

@adaneam
Copy link

adaneam commented Jul 3, 2017

Facing the same issue. Any updates on this?

@lcornejo
Copy link

Looks like something like this will get you going

<PropertyGroup> <MSBuildCommunityTasksPath>$(USERPROFILE)\.nuget\packages\msbuildtasks\1.5.0.235\tools</MSBuildCommunityTasksPath> </PropertyGroup>

obviously change this to your current version, as it implies above I found my tasks target file here:
C:\Users\{username}\.nuget\packages\msbuildtasks\1.5.0.235\tools

@karelkral
Copy link

karelkral commented Sep 12, 2018

The problem is using NuGet as Package reference. I this case there is no installation folder relative to solution, only a local folder mentioned by lcornejo. I solved this by copying task files to path in solution dir (in example .build) and modified paths is .csproj pointing to this dir.

@CADbloke
Copy link

CADbloke commented Aug 29, 2019

my csproj ended up with this...

<PropertyGroup>
    <MSBuildCommunityTasksPath>$(SolutionDir)\packages\MSBuildTasks.1.5.0.235\tools</MSBuildCommunityTasksPath>
  </PropertyGroup>  
  <Import Project="$(MSBuildCommunityTasksPath)\MSBuild.Community.Tasks.Targets" />

@tkolb-recom
Copy link

Dropping this here for all late searchers:

I just placed the package reference and MSBuild (nowadays as of VS2022?) imports the targets automatically:

  <ItemGroup>
  	<PackageReference Include="MSBuildTasks" Version="1.5.0.235"/>
  </ItemGroup>

One can check this in the generated obj\*.g.targets file:

<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <ImportGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
...
    <Import Project="$(NuGetPackageRoot)msbuildtasks\1.5.0.235\build\MSBuildTasks.targets" Condition="Exists('$(NuGetPackageRoot)msbuildtasks\1.5.0.235\build\MSBuildTasks.targets')" />
...
  </ImportGroup>
</Project>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants