Friday, July 28, 2017

Unable to find the service reference in Portable class library / Also unable to update service reference in Portable Class Library

Unable to find the service reference in Portable class library / Also unable to update service reference in Portable Class Library


I have created a portable class library for my cross platform application. However my plan is to consume the WCF methods for the data access.

Now the issue is...........

When I am trying to add the service reference in the portable class library - I don't see any provision to do it.

Here is the quick solution I figured out!...


Step 1:

Go to the application (ClassLibrary) properties and uncheck the Windows Phone 8.1 and uncheck the ASP.NET Core 1.0 and check the Silverlight (This is a temporary stuff until you will be able to see the provision to add service reference.)



Step 2:

Now you could see the Add service reference. So, create the service reference by entering the Url, give a meaning full name for service reference. Click ok

Step 3:

Rename Packages.config to Packages.config.bak - We are doing this to temporarily remove the package references.

Step 4:

Now revert back the changes in the 'Change Targets' window (displayed image above).

Step 5:

Revert back the file name for Packages.config.bak to Packages.config. Finally build the project without any errors.

If still errors exist comment on the post for quick answers.