2015-11-30 27 views
0

我正在为所有移动和桌面平台开发跨平台应用程序。这一切都在C#中。我正在使用XamarinVisual Studio中工作。这是一个客户端 - 服务器应用程序,所以我使用WCF。Windows Phone 8中的System.ServiceModel发生了什么?

通过Miguel Castro: Extreme WCF启发我分了我的解决方案为客户WinFormsProxyContractsServicesConsole服务器主机。但项目如代理合同必须创建为PCL(便携式类库),这是我的问题 - 我不能在Windows 10或Windows Phone PCL中使用System.ServiceModel。这是怎么回事?为什么?

什么是最好的解决方案?

编辑: 我想Windows Universal 10没有问题,只有Windows Phone 8。当我检查Windows 10时,它会自动检查回Windows 8。 VS说:下面将被自动定位,因为支持同一套便携式的API:Windows 8的

EDIT2:为了更加清楚,我挣扎在便携类Libiray实施这个(下)与检查的Windows Phone 8

using System.ServiceModel; 

namespace Contracts 
{ 
    [ServiceContract] 
    public interface IMyService 
    { 
     [OperationContract] 
     int GetSomething(); 
    } 
} 

回答

1

就拿上的API支持通用Windows平台上引用一看here

可以消耗 WCF服务从Windows Phone的8(如详细here),但我不能够找到,从Windows Phone的支持托管WCF服务8.

+0

好吧,我想'通用的Windows 10的任何文件'不是问题。只有'Windows Phone 8' – Tom

+0

Windows Phone 8是通用Windows平台的一部分 –

+0

我在我的PCL属性中检查'Windows Phone 8'。而我没有'System.ServiceModel'。这是否意味着我无法在Windows Phone 8应用程序中使用我的服务? – Tom