I am trying the petshop client generation example on github and autorest just exits without creating anything or throwing any errors. Autorest behaves like I did not pass any arguments. Attached is a screenshot of my powershell execution.
-
1I'm having the same problem. I got it to work by manually downloading the AutoRest nuget package and running the same command with the executable from the package. – P.N. Nov 03 '17 at 10:02
-
I reformatted the drive and reinstalled everything and that fixed the issue. I have no idea what was causing it though. I opened I ticket on GitHub for it, but I closed the issue once I was no longer able to reproduce it. https://github.com/Azure/autorest/issues/2686 You should open a new one and reference mine, so they know multiple people are seeing this. – busbina Nov 03 '17 at 17:21
3 Answers
Try executing your same command but add --verbose at the end to tell autorest to print out any errors. I was experiencing the same problem and what worked for me was creating the following readme.yml file and simply running the command
autorest readme.yml
With those two things (readme.yml and the command) I was able to generate the code in csharp without any issues.
Image of Readme.yml for csharp code generation:

- 91
- 1
- 5
-
there is also the `--debug` option that actually shows what it does. For me it says _emitting file foo_, but doesn't – Markus Nov 26 '19 at 11:59
For me what finally worked was:
- Install the latest
Node
from https://nodejs.org/ - Go to
C:\Users\%userprofile%\AppData\Roaming\npm
and delete the 2autorest
files there if you have them. - Open a
Command Prompt
(typecmd
in theaddress
of anyWindows folder
) In the
Command Prompt
type this command:npm cache clean -f
Now, also in the same
Command Prompt
, type this command:npm install autorest -g
You should now be able to generate your client.

- 28,927
- 17
- 154
- 183
This answer on GitHub repo of Autorest, suggest that you execute
autorest --reset
after updating. It removes older plugins of Autorest. I had the same problem (without updating Autorest) and it has solved after that.

- 2,922
- 2
- 35
- 42