Windows Universal 10 missing definitions for Socket and Thread

Trying to get my app to run on a Raspberry Pi 2 with Windows IoT using Universal 10 build. Followed the steps that others seem to be using with success, including checking the Unity C# Projects box.

Using 5.2.1p1 to get around some of the other name spacing bugs.

When I try to build, I get compiler errors for the Socket and Thread objects.

Just a couple of examples, but every function I call on the objects results in an error:

Assets\Scripts\UdpBroadcastClient.cs(48,10): error CS1061: ‘Socket’ does not contain a definition for ‘Close’ and no extension method ‘Close’ accepting a first argument of type ‘Socket’ could be found (are you missing a using directive or an assembly reference?)

Assets\Scripts\UdpBroadcastClient.cs(111,11): error CS0117: ‘Thread’ does not contain a definition for ‘Sleep’

Anyone have some ideas?

It seems that these methods in fact don’t exist in the Windows Store subset of the .NET Framework.

You can replace .Close() with .Dispose().

Thread.Sleep can be replaced with a PInvoke to Sleep() inside Kernelbase.dll.

1 Like

Is there maybe a list or something which functions are not available and what to replace them with? I am having a very similar problem with Thread and Start, Abort. Also with Stream Close.

1 Like