首页 > 解决方案 > svcutil Generated File unity UWP 错误

问题描述

使用 Unity 创建与 WCF 主机对话的 Hololens (UWP) 应用程序。我已使用教程创建客户端以与我的主机交谈。就像教程中一样使用 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?)

标签: c#wcfunity3dhololenssvc

解决方案


推荐阅读