Search Unity

Question Build error when UWP platform uses Windows namespaces?

Discussion in 'Netcode for GameObjects' started by roni210, Dec 6, 2021.

  1. roni210

    roni210

    Joined:
    Dec 6, 2021
    Posts:
    1
    Hi all,

    I'm developing for Hololens and ran into an issue where building for the UWP platform while using any Windows namespaces alongside Netcode causes an unidentified build error with no stacktrace reported. This error happens within the first 20 seconds of the build as it compiles scripts:

    upload_2021-12-6_8-23-19.png

    The bug only occurs when both Netcode and Windows are loaded in the same assembly, otherwise builds on the same machine succeed and work as expected. Has anybody run into this? Happy to provide more information if needed. Thanks!

    Steps to Reproduce

    1) Create new Unity 2020.3 project
    2) Install netcode via directions at https://mp-docs.dl.it.unity3d.com/docs/migration/install/index.html
    3) Create any script that imports and uses a Windows namespace, eg:
    Code (CSharp):
    1. #if !UNITY_EDITOR
    2.     using Windows.Networking.Sockets;
    3. #endif
    4.  
    5. public class ImportWindowsNetworking
    6. {
    7. #if !UNITY_EDITOR
    8.     private StreamSocket _socket;
    9. #endif
    10. }
    11.  
    4) Switch to UWP build platform and attempt to build.
     
    graudins likes this.