Azure-Samples / app-service-api-dotnet-todo-list

A simple Todo list application built using Web API and Azure API Apps
MIT License
59 stars 150 forks source link

Unable to use Add REST API client #7

Closed weitzhandler closed 7 years ago

weitzhandler commented 7 years ago

After reading this page, when trying to use this option to Xamarin portable app client (from a swagger json file), I get the following message:

Generating client code and adding to project started Generate client code for REST API with following parameters: REST API Name: MyProject API info, Base namespace: MyProject.App, Metadata file path: C:\Users\weitz\OneDrive\Documents\Visual Studio 2015\Projects\MyProject\src\MyProject\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

Steps to reproduce:

wondering639 commented 7 years ago

Solution can meanwhile be found in the comments of https://docs.microsoft.com/en-us/azure/app-service-api/app-service-api-dotnet-get-started:

Jabele 1 day ago @mshetty27 @ashwin Add the Newtonsoft.Json.dll (7.0.1 version) to the C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE folder. Re-run Add Rest Client command.

weitzhandler commented 7 years ago

That solved the problem. Thanks a lot @wondering639. Anyway, looks like the generator isn't sufficient enough, my consumer is a XAML project and thus I need generated INPC entities.

I wonder why there is no reliable in-project page for coordinating WebApi generation into neighboring projects in solution, the generation should be independent to swagger I think, there should just be a way to marry a client and a WebApi having the client entities generated (with some customizable options, maybe T4) in the client. Here's my suggestion on UserVoice, please vote and share your thoughts.