autorest icon indicating copy to clipboard operation
autorest copied to clipboard

Package 'AutoRest 1.0.1' has a package type 'DotnetCliTool' that is not supported by project

Open tomlazelle opened this issue 9 years ago • 9 comments

While using CakeBuild to build my SDK I received this error, the previous version was working correctly.

Project is .netcore 1.1

tomlazelle avatar May 23 '17 17:05 tomlazelle

I'm going to need a bit more information.

Your project is using dotnet-cli targeting .net standard 1.1?

How are you restoring the package? (using dotnet restore or nuget ?)

fearthecowboy avatar May 23 '17 17:05 fearthecowboy

I am using nuget with CakeBuild

tomlazelle avatar May 23 '17 18:05 tomlazelle

I also get the same error when trying to update the NuGet package from within Visual Studio 2017: Package 'AutoRest 1.1.0' has a package type 'DotnetCliTool' that is not supported by project

piersrobcoleman avatar Jul 07 '17 16:07 piersrobcoleman

I solved this by manually adding the reference with the fofllowing lines in the csproj:

<ItemGroup> <DotNetCliToolReference Include="AutoRest" Version="1.1.0" /> </ItemGroup>

Then Right-Click on Solution -> Restore NuGet Packages And no more errors :)

ghost avatar Jul 12 '17 14:07 ghost

@remypalto I tried, no errors but AutoRest still not installed.

ThisNoName avatar Jul 12 '17 16:07 ThisNoName

Ok, let's make sure that we have the right set of expectations:

The AutoRest NuGet package is a dotnet-cli tool package that you can use to do code generation.

Unfortunately, because of limitations in the way that nuget works, that package only supports the new dotnet-cli projects. (I tried enabling multiple package types, but the nuget client in VS doesn't support those at all)

If you want to use AutoRest with a desktop/full framework app, you'll have to install node and use the npm command to install it. (see https://aka.ms/autorest/install )

Otherwise

The closest that I can offer you at this point is to download the nuget package manually and unzip it.

use powershell to install to a local folder:

# download and unpack the nuget package into a folder called .\autorest
 $ProgressPreference = 'silentlycontinue' ; iwr https://www.nuget.org/api/v2/package/AutoRest/1.2.1 -outfile autorest.zip
expand-Archive  autorest.zip  -DestinationPath .\autorest

# if you have dotnet-cli tools installed you can autorest  easily:
.\autorest\tools\autorest <parameters>

# for all other cases, manually run the program using the supplied version of nodejs:
.\autorest\tools\win-x64\node.exe .\autorest\node_modules\autorest\app.js  <parameters>

fearthecowboy avatar Jul 14 '17 16:07 fearthecowboy

@fearthecowboy Thanks for the update. I have the latest non-preview VS 2017, created a default core MVC app and try to add AutoRest via Nuget, same error.

Went the node path, works of course. Seems it's node inside the latest nuget package anyway. I was under the impression there's still an autorest.exe that I can skip the rest.

The generated classes and interfaces look really clean. Thanks for the great work.

ThisNoName avatar Jul 14 '17 16:07 ThisNoName

There really isn't an 'AutoRest.exe' anymore -- the core of AutoRest is written in typescript now, and extensions (validators, generators, etc) can be written in any language and work out-of-proc via JSON-RPC.

fearthecowboy avatar Jul 16 '17 17:07 fearthecowboy

Same problem in here...any news?

thdotnet avatar Sep 07 '17 15:09 thdotnet