Share via

WCF service cannot reference a UWP class library

Satish Singh 1 Reputation point
2020-06-13T11:21:34.48+00:00

Hi,

Recently I have been trying to make a UWP version of a sample WPF Interface program written by Jeremy Clark (https://github.com/jeremybytes/learning-interfaces).

In my program, I am using "UWP Class Library" instead of ".NET Framework Class Library". While I am able to reference a WCF service from UWP class library, I am getting an error when I am trying to reference the UWP class library from the WCF service. The exact error message I am getting is "Unable to add reference to project".

Next, I replaced all UWP class library to .NET Framework class library. Now I could reference it from the WCF service. However, now I cannot reference the .NET class library from a UWP blank app.

I even tried using ".NET Standard Class Library". However, calling a service reference from it creates a very different ServiceClient class with some standard methods like GetData() missing from the class.

I would like to use UWP Class Library. Kindly suggest a way in which I could reference it from WCF service.

Developer technologies | Universal Windows Platform (UWP)
0 comments No comments

1 answer

Sort by: Most helpful
  1. Alex Tjahjana 1 Reputation point
    2020-06-13T14:06:36.683+00:00

    Hi,

    Have you tried to reference System.Runtime.Serialization.Primitives.dll as this post suggested: https://stackoverflow.com/questions/34292295/how-to-share-a-library-between-a-wcf-service-application-and-a-uwp-app ?
    I think you can download it at: http://www.microsoft.com/en-us/download/details.aspx?id=40727

    Was this answer helpful?


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.