svcutil生成的文件统一UWP错误

时间:2018-07-18 21:22:51

标签: c# wcf unity3d hololens svc

使用Unity创建与WCF主机通信的Hololens(UWP)应用程序。我已使用this教程来创建客户端以与主机对话。就像本教程中一样,使用svcutil生成代理。

当我通过按下播放按钮统一运行代码时,它可以完美运行且没有错误。但是,当我构建项目时,生成的代码给了我很多错误。我已将代码段和错误消息放在底部。

不确定svcutil是否存在问题,或者不确定统一编译为UWP的方式。任何帮助,将不胜感激,谢谢。

教程链接:http://gyanendushekhar.com/2016/04/21/how-to-call-wcf-service-in-unity

这是给我带来麻烦的那一行:

[System.ServiceModel.OperationContractAttribute(IsOneWay = true, Action = "http://tempuri.org/...")]

这些是错误:

error CS0433: The type 'OperationContractAttribute' exists in both 'System.ServiceModel.Primitives, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' and 'System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
error CS0246: The type or namespace name 'IsOneWay' could not be found (are you missing a using directive or an assembly reference?)
error CS0246: The type or namespace name 'Action' could not be found (are you missing a using directive or an assembly reference?)

0 个答案:

没有答案