2

I am unable to use the Add... REST API Client... option in Visual Studio 2015 with all the latest updates and Azure Tools v2.9 installed. When I select the option I am presented with the proper dialog to provide either a url or the file path for the swagger json file. Regardless of which option I select I get the following error message:

Generating client code and adding to project started Generate client code for REST API with following parameters: REST API Name: ToDoListAPIClient, Base namespace: ToDoListAPI, Metadata file path: C:\Users\ken\AppData\Local\Temp\WebToolsAutoRest\ToDoListAPIClient\201702032141192827\swagger.json Exception: Could not load file or assembly 'Newtonsoft.Json, Version=7.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The system cannot find the file specified. Generating client code and adding to project failed Adding REST API client for failed

How can I resolve this problem?

Ken Brannigan
  • 607
  • 8
  • 16
  • Another option is to use [Swagger Codegen](https://github.com/swagger-api/swagger-codegen), which supports API clients, server stubs and documentation generation. Just export the Swagger/OpenAPI spec and use https://editor.swagger.io to generate the code. – William Cheng Feb 05 '17 at 13:50

1 Answers1

1

Make sure you download the proper version of the Newtonsoft.Json package by running the command: PM> install-package Newtonsoft.Json -Version 7.0.1

Then copy the Newtonsoft.Json assembly (version 7.0.0.0) to C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE.

This should work around the issue.

Bob Jacobs
  • 26
  • 1