c# - 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?)
解决方案
推荐阅读
- machine-learning - 机器学习算法来预测/查找/收敛以纠正数学模型中的参数
- python - 如何对 pandas 数据框进行二进制搜索以查找列值的组合?
- angular - route.snapshot 在 angular8 解析器中给出 null
- r - 在 stargazer 中计算偏度和峰度
- angular - 在 Typescript / Angular 中包含相同单词时的字符串相等
- jq - 如何使用 jq 更新键/值
- python - 验证数据的性能比 keras 中的训练数据差
- sql - 在 SQL Server 中将重复数据从行转移到列
- python - python - 如何计算Python中不同格式的两个日期之间的天数?
- jenkins - 由于收件人列表为空,Jenkins Pipelines 定期构建不发送电子邮件通知