nil4 / dotnet-transform-xdt

Modern .NET tools and library for XDT (Xml Document Transformation)
Apache License 2.0
118 stars 12 forks source link

Package type 'DotnetCliTool' is not supported by project #16

Closed deastr closed 7 years ago

deastr commented 7 years ago

I have a ASP.NET Core 1.1 MVC project targeting net452 and I'm trying to use Microsoft.DotNet.Xdt.Tools with it. I've tried to install it using Nuget but I'm getting this error. Is it not usable in this .NET Core version?

Package 'Microsoft.DotNet.Xdt.Tools 1.2.0' has a package type 'DotnetCliTool' that is not supported by project 'MyProject'.

csproj:

<PropertyGroup>
    <TargetFramework>net452</TargetFramework>
    <RuntimeIdentifier>win10-x64</RuntimeIdentifier>
    <PreserveCompilationContext>true</PreserveCompilationContext>
    <OutputType>Exe</OutputType>
  </PropertyGroup>
nil4 commented 7 years ago

It's not currently possible to install CLI tools using NuGet; they can only be installed by editing the project file. This is mentioned in the readme file in this repository:

Edit the XdtSample.csproj file and inside an element, add a reference to this XDT tool. Note that you cannot use the NuGet Package Manager UI in Visual Studio 2017 to CLI tool references; they must currently be added by editing the project file.

There are a few NuGet issues related to this, including https://github.com/NuGet/Home/issues/4190, https://github.com/NuGet/Home/issues/4256, https://github.com/NuGet/Home/issues/4901 and https://github.com/NuGet/Home/issues/5086; I encourage you to add your feedback there.

I will close this issue since the problem is not related to the code in this repository, and cannot be solved here.