Unity 5.1.0 Windows Store build error

Hi there,

I’m having trouble building for Windows Store 8.1 on Unity 5.1.0.f3. I switched the platform to Windows Store (SDK 8.1), and set the Compilation Overrides to “Use Net Core”.

http://docs.unity3d.com/Manual/windowsstore-missingtypes.html

According to the manual above, Windows Store uses .Net and WinRT to build and they are included in Unity 5. However, when I use the directive and build, I still get errors.

#if NETFX_CORE
using WinRTLegacy.IO.StreamReader;
using WinRTLegacy.IO.StreamWriter;

using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using System.Text;

#else
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Text;
#endif

Without the #if NETFX_CORE directive, it throws the following error.

Assets\CommonScript\MapTemplate.cs(126,12): error CS1061: ‘System.IO.MemoryStream’ does not contain a definition for ‘Close’ and no extension method ‘Close’ accepting a first argument of type ‘System.IO.MemoryStream’ could be found (are you missing a using directive or an assembly reference?)

With the #if NETFX_CORE directive as above, it throws the following error.

Assets\CommonScript\MapTemplate.cs(2,7): error CS0138: A using namespace directive can only be applied to namespaces; ‘WinRTLegacy.IO.StreamReader’ is a type not a namespace

Why can’t Unity find the namespace although the manual says they are included?
Am I missing something?

Thanks!

I have researched this topic, and everything I can find says that System.IO is not available to Windows apps