Wednesday, January 25, 2017

Add -> REST Api Client Generates exception. How to fix it?

Leave a Comment

After selecting "Add" and "REST API Client", VS generates an exception (no idea why this option occurs so often). I do not understand it. How to fix this? Below, you can see my VS2015 environment and screenshots.

enter image description here enter image description here

2 Answers

Answers 1

According the error , the RestartGetway method is not implement. So

  1. please check your REST API on Azure to make sure all method in your API have been implemented first.
  2. You could try add your REST API on another machine to make sure this issue related to the REST API or Visual Studio itself.

And I also tried Add a REST API into my UWP app from Azure it is successful in my side. I'm using Visual Studio 2015 with Update 3. The version should be 14.0.25431.01.

  1. Please check whether there has any updates for your Visual Studio 2015 from

Tools -> Extensions and Updates -> Updates.

In addition, all Azure related tools version are listed in below.

  1. Please make sure all these tools on your machine are the same with mine.
  • Microsoft Azure Mobile Service Tools 1.4
  • Azure App Service Tools v2.8.1
  • Common Azure Tools 1.8

Answers 2

It would be hard to give a definite answer to this without having the issue reproduced locally but here are some steps that can help you investigate and potentially fix your issue:

Investigate:

  • This seems to be an issue with Visual Studio Azure extension assemblies you have, specifically Microsoft.VisualStudio.web.WindowsAzure.Impl
  • The assembly should exists at this location: C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\Microsoft\Web Tools Azure

  • Download a .NET reflector tool such as ILSpy.exe from http://ilspy.net/

  • Load the assembly in ILSpy and navigate to the namespace Microsoft.VisualStudio.Web.WindowsAzure.APIApps.Impl, then expand the VSAzureAPIService you should find the method RestartGateway.

  • If you can't find it then here is your problem and if you do then you will see the code that throws this exception.

Fix

Assuming we see there is an issue with this version of the DLL, you can take the following actions to resolve:

  • Backup and remove the DLL "Microsoft.VisualStudio.Web.WindowsAzure.APIApps.Impl"

  • Uninstall/Reinstall or Repair the MS Azure SDK, you can download this straight from VS or from here: https://www.visualstudio.com/vs/azure-tools/

  • Make sure you have the DLL back in the right folder, you can also look at the method again to verify it has been fixed

If this works for you or have done further steps to fix this please share and good luck!

If You Enjoyed This, Take 5 Seconds To Share It

0 comments:

Post a Comment