【发布时间】:2017-08-10 14:30:37
【问题描述】:
我正在尝试将 GraphQL 实现到 Unity3D(版本 2017.1.0f3 Personal)中。我正在使用 .NET 4.6(实验),但尽管如此,Unity 不支持动态关键字。这很奇怪,因为 .NET 4.0 它是 .NET 的一部分。除了在 Unity 中。我在谷歌上搜索一些如何让它工作的解决方案,但没有动态关键字的解决方案。错误是这样的:
Severity Code Description Project File Line Suppression State
Error CS1980 Cannot define a class or member that utilizes 'dynamic'
because the compiler required type
'System.Runtime.CompilerServices.DynamicAttribute' cannot be found. Are you
missing a reference? skiing-prototype (1) D:\skiing-prototype
(1)\Assets\Scripts\GraphQL.cs 62 Active
这是使用 GraphQL C# 客户端的唯一警告。有没有人尝试过让它工作?我还没有发现任何更大的努力来启动和运行它。
编辑:
我在这里使用这个客户端:https://github.com/bkniffler/graphql-net-client
这也是来自 Visual Studio 的错误,但在 Unity 控制台中也显示错误,会立即更新确切内容
Assets/Scripts/GraphQL.cs(80,16): error CS1980: Dynamic keyword requires
`System.Runtime.CompilerServices.DynamicAttribute' to be defined. Are you
missing System.Core.dll assembly reference?
这是unity editor错误,好像和visual studio一样
【问题讨论】:
-
您引用的是 Microsoft.CSharp.dll 吗?见here
-
不,我没有,因为在 Unity 下,我无法从 Visual Studio 中传递任何类型的 dll,仅来自此插件文件夹
-
也是因为这个错误 CS1703: 已经导入了具有相同标识的程序集“Microsoft.CSharp”。考虑删除其中一个引用 Assets/Plugins/Microsoft.CSharp.dll(与先前错误相关的符号位置)Microsoft.CSharp.dll(与先前错误相关的符号位置)编译失败:1 个错误,0警告
-
Visual Studio 版本是多少?
-
visual studio 2017 社区