gpt4 book ai didi

c# - 统一和缺失的方法和类

转载 作者:太空宇宙 更新时间:2023-11-03 12:37:10 24 4
gpt4 key购买 nike

我使用 unity 5.5.0b10 并为 Windows 10 创建应用程序,但问题也出在 unity 5.4.0f3 中。
当我在 unity 中调试和运行游戏时一切正常,但是当我试图构建项目时,unity 失败并出现这些错误:

error CS0246: The type or namespace name 'TcpClient' could not be found (are you missing a using directive or an assembly reference?)

error CS0117: 'Assembly' does not contain a definition for 'GetAssembly'

我尝试过的解决方案:
* 在播放器设置中从 .NET 2.0 子集更改为 .NET 2.0 但没有帮助
* 将 TcpClient 更改为 Socket ad 它有帮助,但为什么 TcpClient 不起作用?
* 使用 System.AppDomain 而不是 System.Reflection.Assembly 但它写了另一个错误:

The type or namespace name 'AppDomain' does not exist in the namespace 'System' (are you missing an assembly reference?)

我使用程序集的代码是:

IEnumerable<Type> types = Assembly.GetAssembly(typeof(Model)).GetTypes()
.Where(type => type.IsClass && !type.IsAbstract && type.IsSubclassOf(typeof(Model)));

或者应用域:

IEnumerable<Type> types = System.AppDomain.CurrentDomain.GetAssemblies()
.SelectMany(s => s.GetTypes())
.Where(p => typeof(Model).IsAssignableFrom(p));

我该如何解决?
如果您需要屏幕截图等其他内容,请告诉我,我会添加

最佳答案

在 hololens 论坛发帖后,我得到了 james_ashley 的回复
这就是答案 link

关于c# - 统一和缺失的方法和类,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40503154/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com