团结和缺失的方法和类
unity and missing methods and classes
我正在使用 unity 5.5.0b10 并为 windows 10 创建应用程序,但问题也出现在 unity 5.4.0f3 中。
当我调试时一切正常并且 运行 统一游戏但是当我尝试构建项目时统一失败并出现这些错误:
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)));
或 AppDomain :
IEnumerable<Type> types = System.AppDomain.CurrentDomain.GetAssemblies()
.SelectMany(s => s.GetTypes())
.Where(p => typeof(Model).IsAssignableFrom(p));
我该如何解决?
如果您需要屏幕截图等花药,请告诉我,我会添加
在 hololens 论坛上发帖后,我得到了 james_ashley
的答复
这就是答案 link
我正在使用 unity 5.5.0b10 并为 windows 10 创建应用程序,但问题也出现在 unity 5.4.0f3 中。
当我调试时一切正常并且 运行 统一游戏但是当我尝试构建项目时统一失败并出现这些错误:
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)));
或 AppDomain :
IEnumerable<Type> types = System.AppDomain.CurrentDomain.GetAssemblies()
.SelectMany(s => s.GetTypes())
.Where(p => typeof(Model).IsAssignableFrom(p));
我该如何解决?
如果您需要屏幕截图等花药,请告诉我,我会添加
在 hololens 论坛上发帖后,我得到了 james_ashley
的答复
这就是答案 link