Unity Export to Windows 8.1 and Windows 10 Universal

Tobias
Tobias admin
edited September 2016 in Photon Unity Networking (PUN)
For the export to Windows 8.1, you might have to edit the export rules for some assemblies (.dll files) in Unity 5.

Unity 5.x does not enable us to setup "8.1 Universal SDK" for the dll in the Metro-folder. If you do a 8.1 Universal export, you might have to set that dll to "Any SDK" instead of the pre-selected "8.1". Do this if you export and get errors saying that some Photon class was not found. To do so, find the Metro folder, select the Photon dll and edit it with the Inspector.

The Photon dlls in the Metro-folder and in the UWP-folder are meant to be used for the Mono compiler exports. If you use IL2CPP to build your application, you can uncheck the Windows Store platforms from those dlls.

If WebSocket-csharp is causing trouble, exclude it from the export:
\Plugins\WebSocket\websocket-csharp.dll
-> Only platform is Editor.

Make sure to check "Internet Client" and "Internet Client and Server" in the publishing settings for Windows 8.1 or Windows 10. It seems that UWP drops the pure "Internet Client" capability and only uses the second one.


These settings also apply to Photon Chat and can be used for the Photon Unity SDK as well.
If you have issues with this, please let us know here.

5.4.0p4 works.

Comments

  • Unity 5.3 now has the build option to use IL2CPP as "scripting backend" for Windows 10 Universal builds.
    With a few tricks, you can make PUN already build with this config!
    • You need to change the dll export settings. The Plugins/Metro/Photon3Unity3d.dll is not compatible with Unity's IL2CPP, as it already is a Metro library. In the inspector, select it and set the "ScriptingBackend" to "Dot Net".
    • Select Plugins/Photon3Unity3d.dll and tick the checkbox WASPlayer. Then set the "ScriptingBackend" to "IL2CPP".
    • You might run into issues with a SupportClass. This is part of PUN and Photon. In doubt, it's enough to define "using PunSupportClass = ExitGames.Client.Photon.SupportClass;" instead of "using SupportClass = ExitGames.Client.Photon.SupportClass;". Of course, you need to adjust your code everywhere to actually use PunSupportClass then!
    That should be all for Windows 10 IL2CPP Universal building.
  • [Deleted User]
    edited July 2016
    After successfully building your Windows 10 Universal application in Unity and opening the created Visual Studio solution file, you might get a list of hundreds of errors. These errors occur because there might be missing references to dependencies. This can be solved by using the NuGet Package Manager.

    1) In Visual Studio go to Tools > NuGet Package Manager > Package Manager Settings
    2) On the appearing dialog make sure that the following two options are enabled:
    Allow NuGet to download missing packages
    Automatically check for missing packages during build in Visual Studio
    3) When rebuilding the project now, it should work as intended.

    This has been tested in Unity version 5.3.5f1 as well as 5.4.0f1.
  • PUN v1.74 got a few fixes for Windows Store exports.

    There are a few things you might have to edit / config though.

    Unity 5.x does not enable us to setup "8.1 Universal SDK" for the dll in the Metro-folder. So you might have to set it to "Any SDK" instead of the pre-selected "8.1". Do this if you export and get errors saying that some Photon class was not found.

    The Photon dlls in the Metro-folder and in the UWP-folder are meant to be used for the Mono compiler exports. If you use IL2CPP to build your application, you can uncheck the Windows Store platforms from those dlls.