Package 'AutoRest 1.0.1' has a package type 'DotnetCliTool' that is not supported by project
While using CakeBuild to build my SDK I received this error, the previous version was working correctly.
Project is .netcore 1.1
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 ?)
I am using nuget with CakeBuild
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
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 :)
@remypalto I tried, no errors but AutoRest still not installed.
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 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.
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.
Same problem in here...any news?