0

我正在为所有移动和桌面平台开发跨平台应用程序。这一切都在 C# 中。我正在Visual Studio使用Xamarin. 这是一个客户端-服务器应用程序,所以我使用 WCF。

灵感来自Miguel Castro:Extreme WCF我将我的解决方案分为WinForms客户端、、、和Proxy服务器Contracts主机。但是像ProxyContracts这样的项目必须创建为 PCL(可移植类库),这是我的问题 - 我不能在 PCL 中使用System.ServiceModel和 Windows 10 或 Windows Phone。这是怎么回事?为什么?ServicesConsole

最好的走动方式是什么?

编辑:我想没有问题Windows Universal 10,只有Windows Phone 8. 当我检查 Windows 10 时,它会自动检查回Windows 8. VS 说:以下将自动定位,因为支持相同的可移植 API 集:Windows 8

EDIT2:更清楚地说,我正在努力在 Portable Class Libiray 中通过选中的Windows Phone 8实现这个(下)

using System.ServiceModel;

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

1 回答 1

1

在此处查看有关通用 Windows 平台支持哪些 API 的参考资料。

您可以从 Windows Phone 8使用WCF 服务(详见此处),但我找不到任何支持从 Windows Phone 8 托管 WCF 服务的文档。

于 2015-11-30T20:29:20.607 回答