view raw
user1840422 user1840422 - 6 months ago 57
C# Question

unity and missing methods and classes

Im using unity 5.5.0b10 and creating app for windows 10, but the problem also was in unity 5.4.0f3.

Everything is ok when I'm debugging and running the game in unity but when I'm tring to build the project unity fails with those errors :

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

Solutions I have tried :

* Changing from .NET 2.0 Subset to .NET 2.0 in player settings but it didn't help

* Change TcpClient to Socket ad it helped but why does the TcpClient didn't worked?

* using System.AppDomain instead of System.Reflection.Assembly but it wrote another error :

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

The code I'm using the Assembly is :

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

Or the AppDomain :

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

How can I fix it?

and if you need anther things like screen shots and so on tell me and i will add


After posting in the hololens forum I got an answer from james_ashley
and there's the answer link