[TcpClient]Tcp client Example in wiki. there is a problme in Dll

there is a problem in Tcp server-client code in unity wiki →

i make a dll file with vs2010 and run this whole example but i got a problme

in my console log in unity


Internal compiler error. See the console log for more information. output was:
Unhandled Exception: System.TypeLoadException: Could not load type ‘System.Runtime.Versioning.TargetFrameworkAttribute’ from assembly ‘dll2’.
at (wrapper managed-to-native) System.Reflection.Assembly:InternalGetType (System.Reflection.Module,string,bool,bool)

at System.Reflection.Assembly.GetType (System.String name, Boolean throwOnError, Boolean ignoreCase) [0x00000] in :0

at System.Reflection.Assembly.GetType (System.String name) [0x00000] in :0

at Mono.CSharp.RootNamespace.GetTypeInAssembly (System.Reflection.Assembly assembly, System.String name) [0x00000] in :0

at Mono.CSharp.RootNamespace.LookupTypeReflection (Mono.CSharp.CompilerContext ctx, System.String name, Location loc, Boolean must_be_unique) [0x00000] in :0

at Mono.CSharp.GlobalRootNamespace.LookupTypeReflection (Mono.CSharp.CompilerContext ctx, System.String name, Location loc, Boolean must_be_unique) [0x00000] in :0

at Mono.CSharp.Namespace.LookupType (Mono.CSharp.CompilerContext ctx, System.String name, Location loc) [0x00000] in :0

at Mono.CSharp.Namespace.Lookup (Mono.CSharp.CompilerContext ctx, System.String name, Location loc) [0x00000] in :0

at Mono.CSharp.TypeManager.CoreLookupType (Mono.CSharp.CompilerContext ctx, System.String ns_name, System.String name, Kind type_kind, Boolean required) [0x00000] in :0

at Mono.CSharp.TypeManager.InitCoreTypes (Mono.CSharp.CompilerContext ctx) [0x00000] in :0

at Mono.CSharp.Driver.Compile () [0x00000] in :0

at Mono.CSharp.Driver.Main (System.String args) [0x00000] in :0


help me!

the link you posted is inaccessible, even when typed in completely http://www.unifycommunity.com/wiki/index.php?title=Simple_TCP/IPClient-_Server

I guess it should be <a href="http://www.unifycommunity.com/wiki/index.php?title=Simple_TCP/IP_Client_-_Server">title=Simple_TCP/IP_Client_-_Server</a> Well there's a problem with the markdown. The first underscore is ignored. I've edited the question to fix the link ;)

3 Answers

3

What do you mean by “run the whole example”?

You know that the server is a standalone application that has nothing to do with Unity. It’s a seperate VS project and should be compiled as .exe

I guess you put the server stuff into Unity which won’t work. The Server uses windows.forms…

Just create a c# script in Unity, and copy the code to it. Do not use Dll.

If you really need to make the DLL work in unity, change its target framework under Application in the Project’s properties to .Net Framework 3.5 or less. This will solve your issue.