简体   繁体   English

Windows Phone 8中的System.ServiceModel发生了什么?

[英]What happened with System.ServiceModel in Windows Phone 8?

I'm working on cross-platform application for all mobile and desktop platforms. 我正在为所有移动和桌面平台开发跨平台应用程序。 It's all in C#. 全部在C#中。 I'm working in Visual Studio using Xamarin . 我正在使用XamarinVisual Studio工作。 It's a client-server app, so I use WCF. 这是一个客户端服务器应用程序,因此我使用WCF。

Inspired by Miguel Castro: Extreme WCF I divided my solution into WinForms client, Proxy , Contracts , Services and Console server host. 受到Miguel Castro的启发:Extreme WCF我将解决方案分为WinForms客户端, ProxyContractsServicesConsole服务器主机。 But projects like Proxy or Contracts must be created as PCL (Portable Class Library) and here is my problem - I can't use System.ServiceModel in PCL with Windows 10 or Windows Phone. 但是必须将诸如ProxyContracts之类的项目创建为PCL(便携式类库),这是我的问题-我无法在Windows 10或Windows Phone的PCL中使用System.ServiceModel What's going on? 这是怎么回事? Why? 为什么?

What's the best walkaround? 最好的解决方法是什么?

EDIT: I guess there is no problem with Windows Universal 10 , only with Windows Phone 8 . 编辑:我想Windows Universal 10没问题,只有Windows Phone 8没问题。 When I check Windows 10, it automatically check back to Windows 8 . 当我检查Windows 10时,它会自动检查回到Windows 8 VS says: The following will be automatically targeted because the support the same set of portable APIs: Windows 8 VS说: 由于支持相同的可移植API集,因此以下内容将自动成为目标:Windows 8

EDIT2: To be even more clear, I'm struggling implementing this (below) in Portable Class Libiray with checked Windows Phone 8 : EDIT2:更清楚地说,我正在努力通过已检查的Windows Phone 8在可移植类Libiray中实现此(如下)

using System.ServiceModel;

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

Take a look here for references on which APIs are supported on the Universal Windows Platform. 在此处查看通用Windows平台上支持哪些API的参考。

You can consume WCF services from Windows Phone 8 (as detailed here ) but I am not able to find any documentation that supports hosting WCF services from Windows Phone 8. 您可以从Windows Phone 8 使用 WCF服务(如此处所述 ),但是我找不到任何支持从Windows Phone 8托管WCF服务的文档。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM