I have a self-hosted WCF service, .NET framework 4.5.2, using NetTcpBinding, and a WPF client (4.5.2 also) consuming this service remotely. Thus far, all of my OperationContracts have been synchronous.
I want to add an asynchronous OperationContract to the WCF service, but call it synchronously from the client (the reason for this is so I can use async/await inside the service method).
The catch: this solution doesn't use service references or SvcUtil. We're using the shared library pattern where the service contracts are defined in a shared library referenced by both the client and server. Client proxies are created using ChannelFactory.CreateChannel.
Is that even feasible? I need to keep async/await out of the client but use it in the server method. If it's not possible, can I make the OperationContract synchronous but treat it like a Main method and use GetAwaiter().GetResult(), or will I run into deadlock issues?