Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only.

    Please, do not make any changes to your username or email addresses at id.unity.com during this transition time.

    It's still possible to reply to existing private message conversations during the migration, but any new replies you post will be missing after the main migration is complete. We'll do our best to migrate these messages in a follow-up step.

    On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live.


    Read our full announcement for more information and let us know if you have any questions.

Question Code under #if WINDOWS_UWP is greyed out in Visual Studio

Discussion in 'Windows' started by Moebot, Feb 17, 2021.

  1. Moebot

    Moebot

    Joined:
    Dec 8, 2020
    Posts:
    2
    Hi there,

    I am developing for HoloLens 2 with Unity + Visual Studio. The project is set up correctly as described in the Microsoft Mixed Reality docs (i have already deployed the app multiple times), the Build Platform is set to Universal Windows Platform.

    Some of the packages I am using have scripts with the WINDOWS_UWP directive. All the code inside this block is greyed out. This makes it impossible to write any code or fix bugs.

    Can someone explain to me whats wrong here?

    There is already a similar post, but the only answer is no solution and doesn't explain anything:
    https://forum.unity.com/threads/eve...ven-though-build-settings-targets-uwp.957251/

    Unity 2019.4.16f1
    Visual Studio Enterprise 2019 16.8.5

    Any help would be much appreciated.
     
  2. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,756
  3. Moebot

    Moebot

    Joined:
    Dec 8, 2020
    Posts:
    2