Networking with Windows Phone 8

We have just upgraded to Unity 4.2 and tried to build one of our projects for Windows Phone 8. However, we get a compilation error saying that TcpClient is not supported in this framework.

We have checked that TcpClient IS supported in .Net 4.5, but it is not supported in Metro apps.

So my question is: Are we doing something wrong? Maybe we haven’t properly configured the Windows phone 8 SDK? Or maybe Unity is not properly supporting it yet?

Thanks in advance for your help.

“Things that are not yet supported:
Network classes, WWW is supported though”

Unity Documentation

I would also like Networking for Windows Store please Unity!!! :slight_smile: :slight_smile:

Error building Player: Exception: Failed to run reference rewriter with command “–target=“Temp/StagingArea\Assembly-CSharp-firstpass.dll” --framework=“C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\WindowsPhone\v8.0,C:\Program Files (x86)\Microsoft SDKs\Windows Phone\v8.0\Libraries” --platform=“C:\Program Files (x86)\Windows Phone Kits\8.0\Windows MetaData\Windows.winmd” --support=“Temp/StagingArea/WinRTLegacy.dll” --winmdrefs=”" --system=System --dbg=pdb --alt=System.Net;System.Net.Sockets,System.Net;System.Xml.Serialization;System.ComponentModel,System.Windows;System.Threading,mscorlib". [Temp/StagingArea\Assembly-CSharp-firstpass.dll]
Error: method System.Collections.Generic.List1 System.Collections.Generic.List1::ConvertAll(System.Converter2)` doesn’t exist in target framework. It is referenced from Assembly-CSharp-firstpass.dll at UnityEngine.Transform SplineController::GetTransforms().
Catastrophic failure while running rrw: System.NullReferenceException: Object reference not set to an instance of an object.
at Unity.ReferenceRewriter.RewriteMethodSpecMemberRefs.Visit(MethodDefinition method)
at Unity.ReferenceRewriter.MethodDefinitionDispatcher.Dispatch(TypeDefinition type)
at Unity.ReferenceRewriter.MethodDefinitionDispatcher.Dispatch()
at Unity.ReferenceRewriter.RewriteOperation.Execute(RewriteContext context)
IS THIS IS A SAME kind of error, not supported in unity?

Since we have been forgotten I am working on a networking library that works cross platform, mainly with the drive to making it work on Windows 8.1 and Windows Phone 8.1

http://forum.unity3d.com/threads/wr…rary-including-windows-universal-apps.286900/

I don’t know if I should say that here but Windows 8 Store and Phone is a bit messy. The APIs for TCP in those two platforms are very different between each other and different from what Unity offers.

We ended up implementing our own socket class for PUN. This is then implemented in three ways: Unity, Windows Phone and Windows Store. Each variant is included in a assembly file (dll) and put into Unity’s special Plugins (sub)folders. The trick is: We use one class only and when Unity generates the Phone or Store projects, it replaces the dll it uses with the one specific for the platform. It looks the same but works different inside.

A new networking solution from Unity is coming which will support all platforms. If you don’t need the authoritative in-Unity hosting, you can also try PUN Free which is similar to the older Unity Networking and cross platform.