2
votes

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?)

And

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

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

1
The problem was present in the patch versions Unity? Example: Unity 5.4.2p4 or Unity 5.4.1p4 - OnionFan
No, it was started in 5.4.0f3, it is the first version I used. what I can not understand is how my team mate does't have the problem and we are using the same version of unity - user1840422
I upgraded from 5.4.0f3 right to 5.5.0b10, I didn't had the versions between. - user1840422

1 Answers

1
votes

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